Skip to content
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

Crash in coalesce with mismatched nullable #432

Closed
lgbo-ustc opened this issue Apr 13, 2023 · 2 comments
Closed

Crash in coalesce with mismatched nullable #432

lgbo-ustc opened this issue Apr 13, 2023 · 2 comments

Comments

@lgbo-ustc
Copy link

lgbo-ustc commented Apr 13, 2023

You have to provide the following information whenever possible.

Describe what's wrong
The folllowing query will cause a mismatched nullable in coalesce operator.

-- just a demo to illustrate the case, in real world, spark do some optimization that both sides are nullable
select a, x from(
  select a, nvl(b, null)  as x from t1
  union
  select a, nvl(b, 1) as x from t2
)
group by a,x

since the x from t1 is nullable, but the one from t2 is not. And when merge blocks from both side in ColumnsBuffer, it will fail.

A clear and concise description of what works not as it is supposed to.

A link to reproducer in https://fiddle.clickhouse.com/.

Does it reproduce on recent release?

The list of releases

Enable crash reporting

If possible, change "enabled" to true in "send_crash_reports" section in config.xml:

<send_crash_reports>
        <!-- Changing <enabled> to true allows sending crash reports to -->
        <!-- the ClickHouse core developers team via Sentry https://sentry.io -->
        <enabled>false</enabled>

How to reproduce

  • Which ClickHouse server version to use
  • Which interface to use, if matters
  • Non-default settings, if any
  • CREATE TABLE statements for all tables involved
  • Sample data for all these tables, use clickhouse-obfuscator if necessary
  • Queries to run that lead to unexpected result

Expected behavior

A clear and concise description of what you expected to happen.

Error message and/or stacktrace

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

@lgbo-ustc
Copy link
Author

We need pass a final schema into coalesce.

@lgbo-ustc
Copy link
Author

lgbo-ustc commented Apr 19, 2023

It may be related to the expand op. so close it until the expand is updated to the new substrait plan.

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