File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,35 @@ async def test_final_hint(conn, table_test3):
303303 assert rows [0 ]['value' ] == 45
304304
305305
306+ @pytest .mark .parametrize ('alised' , [False , True ])
307+ async def test_join_final_hint (conn , table_test1 , table_test3 , alised ):
308+ await conn .execute (
309+ table_test1 .insert (),
310+ {'id' : 12 , 'name' : 'name12' },
311+ {'id' : 23 , 'name' : 'name23' },
312+ )
313+ await conn .execute (
314+ table_test3 .insert (),
315+ * [{'key' : 12 , 'value' : i } for i in range (10 )]
316+ )
317+
318+ if alised :
319+ table_test3 = table_test3 .alias ()
320+ query = (
321+ sa .select ([table_test1 .c .name , table_test3 .c .value ])
322+ .select_from (
323+ table_test3 .join (
324+ table_test1 ,
325+ table_test1 .c .id == sa .func .toUInt64 (table_test3 .c .key ),
326+ )
327+ )
328+ .with_hint (table_test3 , 'FINAL' )
329+ )
330+ rows = await conn .fetch (query )
331+ assert len (rows ) == 1
332+ assert rows [0 ]['name' ] == 'name12'
333+
334+
306335async def test_aggregate_function (conn , table_test4 ):
307336 await conn .execute ('INSERT INTO test4 SELECT 1, sumState(123)' )
308337 value = await conn .fetchval (
You can’t perform that action at this time.
0 commit comments