-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: Only allow incompatible cast expressions to run in comet if a config is enabled #362
Merged
Merged
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d592417
Only allow supported cast operations to be converted to native
andygrove 4641540
refactor for readability
andygrove 39ac177
Remove unused import
andygrove c7775a6
formatting
andygrove 4e803cc
avoid duplicate strings in withInfo
andygrove d255879
always cast between same type
andygrove b2d3d2d
save progress
andygrove 889c754
skip try_cast testing prior to Spark 3.4
andygrove 35bcbf9
add config to allow incompatible casts
andygrove 5be20c6
remove unused imports
andygrove a27f846
improve fallback reason reporting
andygrove 23847cd
revert some changes that are no longer needed
andygrove 4bf6c16
save progress
andygrove ed07913
checkpoint
andygrove 5255d6c
save
andygrove 0c8da56
code cleanup
andygrove 22c6394
fix bug
andygrove 7c39b05
fix bug
andygrove 787d17b
improve reporting
andygrove 1b833e2
add documentation
andygrove 7ad2a43
improve docs, fix code format
andygrove ee77b14
fix lint error
andygrove 6d903c3
automate docs
andygrove 4c24e41
automate docs
andygrove b8df40f
remove unused imports
andygrove 4b98bc2
make format
andygrove 6675c72
prettier
andygrove b67d571
change default to false
andygrove 83a70b7
formatting
andygrove e5226f0
set COMET_CAST_ALLOW_INCOMPATIBLE=true in some tests
andygrove 6738544
revert a change
andygrove a1bfdee
spark 3.2 does not support cast timestamp to string
andygrove 15c4989
spotless
andygrove 8c40e17
add links to issues
andygrove be94495
regenerate config docs
andygrove 581d92e
prettier
andygrove 4374fc0
revert prettier
andygrove 2e5e33b
revert a change
andygrove 128e763
revert some redundant test changes
andygrove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!--- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
# Compatibility Guide | ||
|
||
Comet aims to provide consistent results with the version of Apache Spark that is being used. | ||
|
||
This guide offers information about areas of functionality where there are known differences. | ||
|
||
## ANSI mode | ||
|
||
Comet currently ignores ANSI mode in most cases, and therefore can produce different results than Spark. By default, | ||
Comet will fall back to Spark if ANSI mode is enabled. To enable Comet to accelerate queries when ANSI mode is enabled, | ||
specify `spark.comet.ansi.enabled=true` in the Spark configuration. Comet's ANSI support is experimental and should not | ||
be used in production. | ||
|
||
There is an [epic](https://github.com/apache/datafusion-comet/issues/313) where we are tracking the work to fully implement ANSI support. | ||
|
||
## Cast | ||
|
||
Cast operations in Comet fall into three levels of support: | ||
|
||
- **Compatible**: The results match Apache Spark | ||
- **Incompatible**: The results may match Apache Spark for some inputs, but there are known issues where some inputs | ||
will result in incorrect results or exceptions. The query stage will fall back to Spark by default. Setting | ||
`spark.comet.cast.allowIncompatible=true` will allow all incompatible casts to run natively in Comet, but this is not | ||
recommended for production use. | ||
- **Unsupported**: Comet does not provide a native version of this cast expression and the query stage will fall back to | ||
Spark. | ||
|
||
The following table shows the current cast operations supported by Comet. Any cast that does not appear in this | ||
table (such as those involving complex types and timestamp_ntz, for example) are not supported by Comet. | ||
|
||
<!--CAST_TABLE--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,11 @@ under the License. | |
<groupId>org.scala-lang</groupId> | ||
<artifactId>scala-library</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.scala-lang</groupId> | ||
<artifactId>scala-reflect</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
Comment on lines
+61
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't fully understand why this was needed, but I could not compile without this. I found this answer in https://stackoverflow.com/questions/37505380/java-lang-noclassdeffounderror-scala-reflect-api-typecreator |
||
<dependency> | ||
<groupId>com.google.protobuf</groupId> | ||
<artifactId>protobuf-java</artifactId> | ||
|
@@ -270,17 +275,13 @@ under the License. | |
<version>3.2.0</version> | ||
<executions> | ||
<execution> | ||
<id>generate-config-docs</id> | ||
<id>generate-user-guide-reference-docs</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<mainClass>org.apache.comet.CometConfGenerateDocs</mainClass> | ||
<arguments> | ||
<argument>docs/source/user-guide/configs-template.md</argument> | ||
<argument>docs/source/user-guide/configs.md</argument> | ||
</arguments> | ||
<mainClass>org.apache.comet.GenerateDocs</mainClass> | ||
<classpathScope>compile</classpathScope> | ||
</configuration> | ||
</execution> | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code had to move to the spark module so that it can access the cast information