Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public void inferOperandTypes(
false)) {
inferOperandTypesOrError(unwrapTypeFactory(callBinding), callContext, operandTypes);
}
} catch (ValidationException | CalciteContextException e) {
} catch (ValidationException e) {
// let operand checker fail
} catch (CalciteContextException e) {
throw e;
} catch (Throwable t) {
throw createUnexpectedException(callContext, t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ class CalcTest extends TableTestBase {
.isThrownBy(() => util.tableEnv.sqlQuery("SELECT a, foo FROM MyTable"))
}

@Test
def testCoalesceOnInvalidField(): Unit = {
assertThatExceptionOfType(classOf[ValidationException])
.isThrownBy(() => util.verifyExecPlan("SELECT coalesce(SELECT invalid)"))
.withMessageContaining("Column 'invalid' not found in any table")
}

@Test
def testNestedCoalesceOnInvalidField(): Unit = {
assertThatExceptionOfType(classOf[ValidationException])
.isThrownBy(
() => util.verifyExecPlan("SELECT coalesce(SELECT coalesce(SELECT coalesce(invalid)))"))
.withMessageContaining("Column 'invalid' not found in any table")
}

@Test
def testPrimitiveMapType(): Unit = {
util.verifyExecPlan("SELECT MAP[b, 30, 10, a] FROM MyTable")
Expand Down