Skip to content

Commit

Permalink
Replace logical ids with 0 in canonized files as it is done in dq_file (
Browse files Browse the repository at this point in the history
  • Loading branch information
nepal authored Nov 16, 2024
1 parent a261a76 commit 0474cb4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
(let $4 (StructType '('"kind" $3) '('"labels" (DictType $3 $3)) '('"ts" (DataType 'Datetime)) '('type $3) '('"value" (DataType 'Double))))
(let $5 '('"kind" '"labels" '"value" '"ts" 'type))
(let $6 (SoSourceSettings world '"my_project" (SecureParam '"cluster:default_local_solomon") $4 $5 '() '"2023-12-08T14:40:39Z" '"2023-12-08T14:45:39Z" '"{}" (Bool '"false") '"AVG" '"PREVIOUS" (Uint32 '"15")))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($10) $10) '('('"_logical_id" '199948))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($11) $11) '('('"_logical_id" '199975))))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($10) $10) '('('"_logical_id" '0))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($11) $11) '('('"_logical_id" '0))))
(let $9 (ResPull! $1 $2 (Key) (DqCnResult (TDqOutput $8 '"0") '()) '('('type) '('autoref)) '"dq"))
(return (Commit! (Commit! $9 $2) (DataSink '"solomon" '"local_solomon")))
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
(let $4 (StructType '('"kind" $3) '('"labels" (DictType $3 $3)) '('"ts" (DataType 'Datetime)) '('type $3) '('"value" (DataType 'Double))))
(let $5 '('"kind" '"labels" '"value" '"ts" 'type))
(let $6 (SoSourceSettings world '"my_project" (SecureParam '"cluster:default_local_solomon") $4 $5 '() '"2023-12-08T14:40:39Z" '"2023-12-08T14:45:39Z" '"{}" (Bool '"true") '"SUM" '"PREVIOUS" (Uint32 '"25")))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($10) $10) '('('"_logical_id" '199972))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($11) $11) '('('"_logical_id" '199999))))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($10) $10) '('('"_logical_id" '0))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($11) $11) '('('"_logical_id" '0))))
(let $9 (ResPull! $1 $2 (Key) (DqCnResult (TDqOutput $8 '"0") '()) '('('type) '('autoref)) '"dq"))
(return (Commit! (Commit! $9 $2) (DataSink '"solomon" '"local_solomon")))
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
(let $4 (StructType '('"kind" $3) '('"labels" (DictType $3 $3)) '('"ts" (DataType 'Datetime)) '('type $3) '('"value" (DataType 'Double))))
(let $5 '('"kind" '"labels" '"value" '"ts" 'type))
(let $6 (SoSourceSettings world '"my_project" (SecureParam '"cluster:default_local_solomon") $4 $5 '() '"2023-12-08T14:40:39Z" '"2023-12-08T14:45:39Z" '"{}" (Bool '"false") '"SUM" '"PREVIOUS" (Uint32 '"15")))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($10) $10) '('('"_logical_id" '199960))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($11) $11) '('('"_logical_id" '199987))))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($10) $10) '('('"_logical_id" '0))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($11) $11) '('('"_logical_id" '0))))
(let $9 (ResPull! $1 $2 (Key) (DqCnResult (TDqOutput $8 '"0") '()) '('('type) '('autoref)) '"dq"))
(return (Commit! (Commit! $9 $2) (DataSink '"solomon" '"local_solomon")))
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
(let $8 '('"kind" '"value" '"ts" 'type))
(let $9 '($3 $5 '"project" $6))
(let $10 (SoSourceSettings world '"my_project" (SecureParam '"cluster:default_local_solomon") $7 $8 $9 '"2023-12-08T14:40:39Z" '"2023-12-08T14:45:39Z" '"{}" (Bool '"false") '"AVG" '"PREVIOUS" (Uint32 '"15")))
(let $11 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $10)) (lambda '($14) $14) '('('"_logical_id" '199986))))
(let $12 (DqStage '((DqCnUnionAll (TDqOutput $11 '"0"))) (lambda '($15) $15) '('('"_logical_id" '200013))))
(let $11 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $10)) (lambda '($14) $14) '('('"_logical_id" '0))))
(let $12 (DqStage '((DqCnUnionAll (TDqOutput $11 '"0"))) (lambda '($15) $15) '('('"_logical_id" '0))))
(let $13 (ResPull! $1 $2 (Key) (DqCnResult (TDqOutput $12 '"0") '()) '('('type) '('autoref)) '"dq"))
(return (Commit! (Commit! $13 $2) (DataSink '"solomon" '"local_solomon")))
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
(let $4 (StructType '('"kind" $3) '('"labels" (DictType $3 $3)) '('"ts" (DataType 'Datetime)) '('type $3) '('"value" (DataType 'Double))))
(let $5 '('"kind" '"labels" '"value" '"ts" 'type))
(let $6 (SoSourceSettings world '"my_project" (SecureParam '"cluster:default_local_solomon") $4 $5 '() '"2023-12-08T14:40:39Z" '"2023-12-08T14:45:39Z" '"{}" (Bool '"true") '"SUM" '"PREVIOUS" (Uint32 '"25")))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($11) $11) '('('"_logical_id" '200295))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($12) $12) '('('"_logical_id" '200337))))
(let $7 (DqStage '((DqSource (DataSource '"solomon" '"local_solomon") $6)) (lambda '($11) $11) '('('"_logical_id" '0))))
(let $8 (DqStage '((DqCnUnionAll (TDqOutput $7 '"0"))) (lambda '($12) $12) '('('"_logical_id" '0))))
(let $9 '('('type) '('autoref) '('unordered)))
(let $10 (ResPull! $1 $2 (Key) (DqCnResult (TDqOutput $8 '"0") '()) $9 '"dq"))
(return (Commit! (Commit! $10 $2) (DataSink '"solomon" '"local_solomon")))
)
)
3 changes: 3 additions & 0 deletions ydb/library/yql/tests/sql/solomon/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def test(suite, case, cfg, solomon):
assert yqlrun_res.execution_result.exit_code != 0
return [normalize_source_code_path(sanitize_issues(yqlrun_res.std_err))]

with open(yqlrun_res.opt_file, 'w') as f:
f.write(re.sub(r"""("?_logical_id"?) '\d+""", r"""\1 '0""", yqlrun_res.opt).encode('utf-8'))

return [yatest.common.canonical_file(yqlrun_res.results_file, local=True),
yatest.common.canonical_file(yqlrun_res.opt_file, local=True, diff_tool=ASTDIFF_PATH),
yatest.common.canonical_file(yqlrun_res.plan_file, local=True)]

0 comments on commit 0474cb4

Please sign in to comment.