我正在使用速度来从数据库访问数据。这样:
Join <Tuple2 <Customer, Orders >> join = joinComponent
.from (Customer.IDENTIFIER)
.innerJoinOn (Orders.O_CUSTKEY) .equal (Customer.C_CUSTKEY)
.build (Tuples :: of);
我有这个表达式来计算“ o_custkey”:
IntSummaryStatistics dstats = join.stream().mapToInt(t->t.get1().getOCustkey().getAsInt()).summaryStatistics();
Long count = dstats.getCount();
我想将此表达式转换为表示隐式sql查询的字符串。您应该得到这样的内容:
SELECT COUNT (O_CUSTKEY) FROM ORDERS, CUSTOMER WHERE O_CUSTKEY = C_CUSTKEY
我该怎么做?