Skip to content

Commit 41a6c6f

Browse files
authored
Update translation settings in purecalc (#7173)
1 parent 46db233 commit 41a6c6f

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

ydb/library/yql/public/purecalc/common/worker_factory.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,16 @@ TExprNode::TPtr TWorkerFactory<TBase>::Compile(
183183
settings.ModuleMapping = modules;
184184
settings.EnableGenericUdfs = true;
185185
settings.File = "generated.sql";
186+
settings.Flags = {
187+
"AnsiOrderByLimitInUnionAll",
188+
"AnsiRankForNullableKeys",
189+
"DisableAnsiOptionalAs",
190+
"DisableCoalesceJoinKeysOnQualifiedAll",
191+
"DisableUnorderedSubqueries",
192+
"FlexibleTypes"
193+
};
186194
if (BlockEngineMode_ != EBlockEngineMode::Disable) {
187-
settings.Flags = {"EmitAggApply"};
195+
settings.Flags.insert("EmitAggApply");
188196
}
189197
for (const auto& [key, block] : UserData_) {
190198
TStringBuf alias(key.Alias());

ydb/library/yql/public/purecalc/io_specs/arrow/ut/test_spec.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ Y_UNIT_TEST_SUITE(TestMorePullListArrowIO) {
241241
TArrowInputSpec({schema}),
242242
TArrowOutputSpec(schema),
243243
R"(SELECT
244-
`uint64` + 1 as `uint64`,
245-
`int64` - 2 as `int64`,
244+
uint64 + 1 as uint64,
245+
int64 - 2 as int64,
246246
FROM Input)",
247247
ETranslationMode::SQL
248248
);
@@ -318,8 +318,8 @@ Y_UNIT_TEST_SUITE(TestMorePullStreamArrowIO) {
318318
TArrowInputSpec({schema}),
319319
TArrowOutputSpec(schema),
320320
R"(SELECT
321-
`uint64` + 1 as `uint64`,
322-
`int64` - 2 as `int64`,
321+
uint64 + 1 as uint64,
322+
int64 - 2 as int64,
323323
FROM Input)",
324324
ETranslationMode::SQL
325325
);
@@ -393,8 +393,8 @@ Y_UNIT_TEST_SUITE(TestMorePushStreamArrowIO) {
393393
TArrowInputSpec({schema}),
394394
TArrowOutputSpec(schema),
395395
R"(SELECT
396-
`uint64` + 1 as `uint64`,
397-
`int64` - 2 as `int64`,
396+
uint64 + 1 as uint64,
397+
int64 - 2 as int64,
398398
FROM Input)",
399399
ETranslationMode::SQL
400400
);

ydb/library/yql/public/purecalc/io_specs/mkql/ut/test.inl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Y_UNIT_TEST_SUITE(TEST_SUITE_NAME) {
6767
auto program = CREATE_PROGRAM(
6868
inputSpec,
6969
outputSpec,
70-
"SELECT `int64`, `bool`, `string` FROM Input",
70+
"SELECT int64, bool, string FROM Input",
7171
ETranslationMode::SQL, 1
7272
);
7373

@@ -134,9 +134,9 @@ Y_UNIT_TEST_SUITE(TEST_SUITE_NAME) {
134134
inputSpec,
135135
outputSpec,
136136
R"(
137-
SELECT `int64`, `uint64` FROM Input0
137+
SELECT int64, uint64 FROM Input0
138138
UNION ALL
139-
SELECT `bool`, `yson` FROM Input1
139+
SELECT bool, yson FROM Input1
140140
)",
141141
ETranslationMode::SQL, 1
142142
);
@@ -182,7 +182,7 @@ SELECT `bool`, `yson` FROM Input1
182182
auto program = CREATE_PROGRAM(
183183
INPUT_SPEC {schema},
184184
OUTPUT_SPEC {someOptionalSchema},
185-
"SELECT `int64`, `bool`, Nothing(String?) as `string` FROM Input",
185+
"SELECT int64, bool, Nothing(String?) as string FROM Input",
186186
ETranslationMode::SQL, 1
187187
);
188188

@@ -208,7 +208,7 @@ SELECT `bool`, `yson` FROM Input1
208208
CREATE_PROGRAM(
209209
INPUT_SPEC {schema},
210210
OUTPUT_SPEC {someSchema},
211-
"SELECT `int64`, `bool`, Nothing(String?) as `string` FROM Input",
211+
"SELECT int64, bool, Nothing(String?) as string FROM Input",
212212
ETranslationMode::SQL, 1
213213
);
214214
}(), TCompileError, "Failed to optimize");
@@ -234,7 +234,7 @@ SELECT `bool`, `yson` FROM Input1
234234
auto program = CREATE_PROGRAM(
235235
inputSpec,
236236
outputSpec,
237-
"SELECT `int64`, `bool`, `string` FROM Input",
237+
"SELECT int64, bool, string FROM Input",
238238
ETranslationMode::SQL, 1
239239
);
240240

@@ -286,17 +286,17 @@ SELECT `bool`, `yson` FROM Input1
286286
outputSpec,
287287
R"(
288288
SELECT
289-
t0.`int64` AS `int64`,
290-
t0.`uint64` AS `uint64`,
291-
t0.`double` AS `double`,
292-
t1.`bool` AS `bool`,
293-
t1.`string` AS `string`
289+
t0.int64 AS int64,
290+
t0.uint64 AS uint64,
291+
t0.double AS double,
292+
t1.bool AS bool,
293+
t1.string AS string
294294
FROM
295295
Input0 AS t0
296296
INNER JOIN
297297
Input1 AS t1
298-
ON t0.`int64` == t1.`int64`
299-
ORDER BY `int64`
298+
ON t0.int64 == t1.int64
299+
ORDER BY int64
300300
)",
301301
ETranslationMode::SQL, 1
302302
);
@@ -660,7 +660,7 @@ ORDER BY `int64`
660660
auto program = CREATE_PROGRAM(
661661
INPUT_SPEC(inputSchema),
662662
OUTPUT_SPEC(NYT::TNode::CreateEntity()),
663-
"SELECT `int64`, TableName() AS `tname` FROM Input",
663+
"SELECT int64, TableName() AS tname FROM Input",
664664
ETranslationMode::SQL
665665
);
666666

@@ -688,7 +688,7 @@ ORDER BY `int64`
688688
auto program = CREATE_PROGRAM(
689689
INPUT_SPEC(inputSchema).SetTableNames(tableNames),
690690
OUTPUT_SPEC(NYT::TNode::CreateEntity()),
691-
"SELECT `int64`, TableName() AS `tname` FROM TABLES()",
691+
"SELECT int64, TableName() AS tname FROM TABLES()",
692692
ETranslationMode::SQL
693693
);
694694

@@ -724,7 +724,7 @@ $union = (
724724
UNION ALL
725725
SELECT * FROM Input1
726726
);
727-
SELECT TableName() AS `tname`, `int64` FROM $union
727+
SELECT TableName() AS tname, int64 FROM $union
728728
)"
729729
);
730730

@@ -762,7 +762,7 @@ $union = (
762762
UNION ALL
763763
SELECT * FROM $input1
764764
);
765-
SELECT TableName() AS `tname`, `int64` FROM $union
765+
SELECT TableName() AS tname, int64 FROM $union
766766
)"
767767
);
768768

0 commit comments

Comments
 (0)