A dotted identifier whose first component matches a column name resolves that column through ParameterScope.resolveColumn, passes validation, and then fails inside Calcite with an internal IllegalStateException rather than a diagnosable error. A single table is enough:
new SqlExpressionToSubstrait().convert("A.A1", List.of("CREATE TABLE T (A BIGINT, A1 BIGINT)"));
// java.lang.IllegalStateException: Trying to access field A1 in a type with no fields: BIGINT
It is easier to hit by accident across tables — a table named A alongside a different table carrying a column named A:
new SqlExpressionToSubstrait().convert(
"A.A1", List.of("CREATE TABLE A (A1 BIGINT, A2 BIGINT)", "CREATE TABLE B (A BIGINT)"));
// java.lang.IllegalStateException: Trying to access field A1 in a type with no fields: BIGINT
IsthmusExecutionExceptionHandler matches only SqlParseException and CalciteContextException message patterns, so from the CLI this escapes as an unrecognized internal error instead of one of the hints that handler exists to give. Since qualified references are not supported at all (#1319), a user who reaches for A.A1 to disambiguate gets Calcite internals with no pointer; a clear "qualified references are not supported" would be the useful outcome.
Measured on main at ade72bc.
A dotted identifier whose first component matches a column name resolves that column through
ParameterScope.resolveColumn, passes validation, and then fails inside Calcite with an internalIllegalStateExceptionrather than a diagnosable error. A single table is enough:It is easier to hit by accident across tables — a table named
Aalongside a different table carrying a column namedA:IsthmusExecutionExceptionHandlermatches onlySqlParseExceptionandCalciteContextExceptionmessage patterns, so from the CLI this escapes as an unrecognized internal error instead of one of the hints that handler exists to give. Since qualified references are not supported at all (#1319), a user who reaches forA.A1to disambiguate gets Calcite internals with no pointer; a clear "qualified references are not supported" would be the useful outcome.Measured on
mainat ade72bc.