@@ -6773,11 +6773,24 @@ Y_UNIT_TEST_SUITE(TViewSyntaxTest) {
67736773}
67746774
67756775Y_UNIT_TEST_SUITE (CompactNamedExprs) {
6776- Y_UNIT_TEST (TableRowInWrongContext) {
6777- ExpectFailWithError (
6778- " pragma CompactNamedExprs;\n "
6779- " $foo = TableRow();\n "
6780- " select $foo from plato.Input;\n " ,
6781- " <main>:2:8: Error: TableRow requires data source\n " );
6776+ Y_UNIT_TEST (SourceCallablesInWrongContext) {
6777+ TString query = R"(
6778+ pragma CompactNamedExprs;
6779+ $foo = %s();
6780+ select $foo from plato.Input;
6781+ )" ;
6782+
6783+ THashMap<TString, TString> errs = {
6784+ {" TableRow" , " <main>:3:20: Error: TableRow requires data source\n " },
6785+ {" JoinTableRow" , " <main>:3:20: Error: JoinTableRow requires data source\n " },
6786+ {" TableRecordIndex" , " <main>:3:20: Error: Unable to use function: TableRecord without source\n " },
6787+ {" TablePath" , " <main>:3:20: Error: Unable to use function: TablePath without source\n " },
6788+ {" SystemMetadata" , " <main>:3:20: Error: Unable to use function: SystemMetadata without source\n " },
6789+ };
6790+
6791+ for (TString callable : { " TableRow" , " JoinTableRow" , " TableRecordIndex" , " TablePath" , " SystemMetadata" }) {
6792+ auto req = Sprintf (query.c_str (), callable.c_str ());
6793+ ExpectFailWithError (req, errs[callable]);
6794+ }
67826795 }
67836796}
0 commit comments