@@ -146,6 +146,34 @@ func TestMakeSelectQuery(t *testing.T) {
146146 outputYdbTypes : []* ydb.Type {common .MakePrimitiveType (ydb .Type_INT32 ), common .MakePrimitiveType (ydb .Type_STRING )},
147147 err : nil ,
148148 },
149+ {
150+ testName : "between" ,
151+ selectReq : & api_service_protos.TSelect {
152+ From : & api_service_protos.TSelect_TFrom {
153+ Table : "tab" ,
154+ },
155+ What : rdbms_utils .NewDefaultWhat (),
156+ Where : & api_service_protos.TSelect_TWhere {
157+ FilterTyped : & api_service_protos.TPredicate {
158+ Payload : & api_service_protos.TPredicate_Between {
159+ Between : & api_service_protos.TPredicate_TBetween {
160+ Value : rdbms_utils .NewColumnExpression ("col2" ),
161+ Least : rdbms_utils .NewColumnExpression ("col1" ),
162+ Greatest : rdbms_utils .NewColumnExpression ("col3" ),
163+ },
164+ },
165+ },
166+ },
167+ DataSourceInstance : & api_common.TGenericDataSourceInstance {
168+ Kind : api_common .EGenericDataSourceKind_POSTGRESQL ,
169+ },
170+ },
171+ splitDescription : singleSplit ,
172+ outputQuery : `SELECT "col0", "col1" FROM "tab" WHERE "col2" BETWEEN "col1" AND "col3"` ,
173+ outputArgs : []any {},
174+ outputYdbTypes : []* ydb.Type {common .MakePrimitiveType (ydb .Type_INT32 ), common .MakePrimitiveType (ydb .Type_STRING )},
175+ err : nil ,
176+ },
149177 {
150178 testName : "bool_column" ,
151179 selectReq : & api_service_protos.TSelect {
@@ -238,34 +266,6 @@ func TestMakeSelectQuery(t *testing.T) {
238266 outputYdbTypes : []* ydb.Type {common .MakePrimitiveType (ydb .Type_INT32 ), common .MakePrimitiveType (ydb .Type_STRING )},
239267 err : nil ,
240268 },
241- {
242- testName : "unsupported_predicate" ,
243- selectReq : & api_service_protos.TSelect {
244- From : & api_service_protos.TSelect_TFrom {
245- Table : "tab" ,
246- },
247- What : rdbms_utils .NewDefaultWhat (),
248- Where : & api_service_protos.TSelect_TWhere {
249- FilterTyped : & api_service_protos.TPredicate {
250- Payload : & api_service_protos.TPredicate_Between {
251- Between : & api_service_protos.TPredicate_TBetween {
252- Value : rdbms_utils .NewColumnExpression ("col2" ),
253- Least : rdbms_utils .NewColumnExpression ("col1" ),
254- Greatest : rdbms_utils .NewColumnExpression ("col3" ),
255- },
256- },
257- },
258- },
259- DataSourceInstance : & api_common.TGenericDataSourceInstance {
260- Kind : api_common .EGenericDataSourceKind_POSTGRESQL ,
261- },
262- },
263- splitDescription : singleSplit ,
264- outputQuery : `SELECT "col0", "col1" FROM "tab"` ,
265- outputArgs : []any {},
266- outputYdbTypes : []* ydb.Type {common .MakePrimitiveType (ydb .Type_INT32 ), common .MakePrimitiveType (ydb .Type_STRING )},
267- err : nil ,
268- },
269269 {
270270 testName : "unsupported_type" ,
271271 selectReq : & api_service_protos.TSelect {
0 commit comments