Skip to content

TPCDS queries #34, #73 doesn't work with block channels #7719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
abyss7 opened this issue Aug 13, 2024 · 3 comments
Closed

TPCDS queries #34, #73 doesn't work with block channels #7719

abyss7 opened this issue Aug 13, 2024 · 3 comments
Assignees

Comments

@abyss7
Copy link
Collaborator

abyss7 commented Aug 13, 2024

TPCDS queries #34, #73 doesn't work with block channels
Sample problem report: https://proxy.sandbox.yandex-team.ru/6854476973/index.html#suites/efe4970bacd9e1454955dc0317c12f5e/21b6d1b5165606bc/

Initially problem log looks like:

yql_provider_gateway.cpp:21: <main>: Fatal: ydb/library/yql/minikql/mkql_program_builder.cpp:5836: ScalarApply(): requirement !args.empty() failed. Required at least one argument, code: 1

I assume this expression causes problem, because the callable Nothing (which is NULL) has no arguments:

        (case when household_demographics.hd_vehicle_count > 0
	then household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count
	else null
	end)

Intermediate AST looks like:

  (let $7 (Bool 'false))
  (let $8 (Member $5 '"hd_vehicle_count"))
  (let $9 (Coalesce (> $8 (Int32 '0)) $7))
  (let $10 (If $9 (/ (Member $5 '"hd_dep_count") $8) (Nothing (OptionalType (DataType 'Int64)))))

Full AST (at some point): https://paste.yandex-team.ru/285f7141-a0ea-4412-9aaf-197d50760a2d

@zverevgeny zverevgeny changed the title TPCDS queries #34, #73 doesn't work with block channels SsaProgram does not support nulls Aug 13, 2024
@zverevgeny
Copy link
Collaborator

@zverevgeny
Copy link
Collaborator

zverevgeny commented Aug 14, 2024

Null(Nothing) is not supported now in SsaProgram.
In this case it can be optimized out.
In general case, such push-downs must be blocked until Nothing is supported in SSA

@zverevgeny zverevgeny linked a pull request Aug 14, 2024 that will close this issue
@zverevgeny zverevgeny changed the title SsaProgram does not support nulls TPCDS queries #34, #73 doesn't work with block channels Aug 18, 2024
@zverevgeny
Copy link
Collaborator

zverevgeny commented Aug 18, 2024

Rename title to the original one
The're several problems:

  1. SsaProgram doesn't support passing Null in this case: Support NULLs in SSAProgram #7966
  2. Optimizer pushes down unsupported predicates to CS: Do not pushdown NULLs to CS until they are supported #7967
  3. In this case Nothing can be converted to False Swap if with comparator to get rid of nothing #8564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants