@@ -6758,11 +6758,24 @@ Y_UNIT_TEST_SUITE(TViewSyntaxTest) {
67586758}
67596759
67606760Y_UNIT_TEST_SUITE (CompactNamedExprs) {
6761- Y_UNIT_TEST (TableRowInWrongContext) {
6762- ExpectFailWithError (
6763- " pragma CompactNamedExprs;\n "
6764- " $foo = TableRow();\n "
6765- " select $foo from plato.Input;\n " ,
6766- " <main>:2:8: Error: TableRow requires data source\n " );
6761+ Y_UNIT_TEST (SourceCallablesInWrongContext) {
6762+ TString query = R"(
6763+ pragma CompactNamedExprs;
6764+ $foo = %s();
6765+ select $foo from plato.Input;
6766+ )" ;
6767+
6768+ THashMap<TString, TString> errs = {
6769+ {" TableRow" , " <main>:3:20: Error: TableRow requires data source\n " },
6770+ {" JoinTableRow" , " <main>:3:20: Error: JoinTableRow requires data source\n " },
6771+ {" TableRecordIndex" , " <main>:3:20: Error: Unable to use function: TableRecord without source\n " },
6772+ {" TablePath" , " <main>:3:20: Error: Unable to use function: TablePath without source\n " },
6773+ {" SystemMetadata" , " <main>:3:20: Error: Unable to use function: SystemMetadata without source\n " },
6774+ };
6775+
6776+ for (TString callable : { " TableRow" , " JoinTableRow" , " TableRecordIndex" , " TablePath" , " SystemMetadata" }) {
6777+ auto req = Sprintf (query.c_str (), callable.c_str ());
6778+ ExpectFailWithError (req, errs[callable]);
6779+ }
67676780 }
67686781}
0 commit comments