Skip to content

feat: support literal for ARRAY top level #1978

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

comphead
Copy link
Contributor

@comphead comphead commented Jul 2, 2025

Which issue does this PR close?

Closes #1977 .

Rationale for this change

What changes are included in this PR?

How are these changes tested?

@comphead comphead marked this pull request as draft July 2, 2025 15:20
@@ -472,5 +475,4 @@ message DataType {
}

DataTypeInfo type_info = 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm preferring to move all DataType proto message into types.proto

@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2025

Codecov Report

Attention: Patch coverage is 86.07595% with 11 lines in your changes missing coverage. Please review.

Project coverage is 58.75%. Comparing base (f09f8af) to head (2148f5d).
Report is 325 commits behind head on main.

Files with missing lines Patch % Lines
.../scala/org/apache/comet/serde/QueryPlanSerde.scala 88.15% 4 Missing and 5 partials ⚠️
...scala/org/apache/comet/expressions/CometCast.scala 33.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1978      +/-   ##
============================================
+ Coverage     56.12%   58.75%   +2.62%     
- Complexity      976     1239     +263     
============================================
  Files           119      134      +15     
  Lines         11743    13105    +1362     
  Branches       2251     2415     +164     
============================================
+ Hits           6591     7700    +1109     
- Misses         4012     4176     +164     
- Partials       1140     1229      +89     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@parthchandra
Copy link
Contributor

Per the spark documentation these are the literals aupported by Spark - https://spark.apache.org/docs/latest/sql-ref-literals.html
Do we have a specific example we want to support?

@comphead
Copy link
Contributor Author

comphead commented Jul 2, 2025

Per the spark documentation these are the literals aupported by Spark - https://spark.apache.org/docs/latest/sql-ref-literals.html Do we have a specific example we want to support?

Thanks @parthchandra
Apache Spark without org.apache.spark.sql.catalyst.optimizer.ConstantFolding optimizer rule (which is included by default) transforms expressions like array(), array(1, 2, 3), struct() to Literal and if Comet faces this in projection or filter it would fallback to Spark, although it can be executed natively

.build_list_scalar()
}
DataType::Boolean => {
let vals = values.clone();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a macro in followup PR to remove repeated code

@@ -21,6 +21,7 @@

// Include generated modules from .proto files.
#[allow(missing_docs)]
#[allow(clippy::large_enum_variant)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clippy complains on proto enums

if supportedDataType(
dataType,
allowComplex = value == null || Seq(
CometConf.SCAN_NATIVE_ICEBERG_COMPAT,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also support AUTO?

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 this pull request may close these issues.

feat: Support ARRAY literal
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy