Try semiJoin in RelBuilder. Maybe that is what you want.




Thanks~
Haisheng Yuan------------------------------------------------------------------
发件人:<[email protected]>
日 期:2019年06月24日 06:29:38
收件人:Dev<[email protected]>
主 题:Subquery


Although I can build a query which looks like

    val query = 
builder.scan("table1").filter(builder.equals(builder.field("filed_name1"), 
builder.literal("matched_value1"))).project(builder.field("field1_1"))

How can I place this query as subquery which might looks like sql statement 

select * from table2 where field2_1 in (select field1_1 from table1 where 
field_name1 = 'matched_value1')

Below code snippet doesn't get compiled 

buidler.scan("table2").filter(builder.call(IN, builder.field("field2_1"), /* 
query.getRexBuidler*/))

it's because I don't know how to convert query to RexNode. What is the correct 
way of building in clause within filter? Any suggestions? 

Current used calcite core version is 1.19.0

Thanks

Reply via email to