You can use SqlValidator.getFieldOrigins for a SqlNode, or use
RelMetadataQuery.getColumnOrigins for a RelNode.
- Jin
Julian Hyde 于2020年4月17日周五 上午7:29写道:
> At the RelNode level, you can use RelMetadataQuery.getColumnOrigins.
>
> But I’m sure that there’s something available at the SqlNode
At the RelNode level, you can use RelMetadataQuery.getColumnOrigins.
But I’m sure that there’s something available at the SqlNode level, after
validation. PreparedExplain.getFieldOrigins() is what the JDBC driver uses to
provide ResultSetMetadata.getColumnName(int) etc.
Julian
> On Apr 16,
You can customize a RelVisitor to visit the RelNode, and collect the
columns from TableScan's rowtype.
王驰 于2020年4月16日周四 下午11:23写道:
> Hi folks,
>
>
> We're using CalCite in our project for SQL parsing and validating. We have
> a question: is there any way to get all used columns from a SQL?
>
>