-
Notifications
You must be signed in to change notification settings - Fork 336
feat: implement native empty2null spark inner function #4683
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
Open
kazantsev-maksim
wants to merge
75
commits into
apache:main
Choose a base branch
from
kazantsev-maksim:empty2null
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
768b3e9
impl map_from_entries
c68c342
Revert "impl map_from_entries"
d887555
Merge branch 'apache:main' into main
kazantsev-maksim 231aa90
Merge branch 'apache:main' into main
kazantsev-maksim 9500bbb
Merge branch 'apache:main' into main
kazantsev-maksim 9577481
Merge branch 'apache:main' into main
kazantsev-maksim 3791557
Merge branch 'apache:main' into main
kazantsev-maksim 7c2f082
Merge branch 'apache:main' into main
kazantsev-maksim 609a605
Merge branch 'apache:main' into main
kazantsev-maksim a151b2c
Merge branch 'apache:main' into main
kazantsev-maksim ad3e7f5
Merge branch 'apache:main' into main
kazantsev-maksim ea92e4b
Merge branch 'apache:main' into main
kazantsev-maksim 8dfeca3
Merge branch 'apache:main' into main
kazantsev-maksim 559741e
Merge branch 'apache:main' into main
kazantsev-maksim ebda14e
Merge branch 'apache:main' into main
kazantsev-maksim 408152e
Merge branch 'apache:main' into main
kazantsev-maksim d7857b2
Merge branch 'apache:main' into main
kazantsev-maksim aef41be
Merge branch 'apache:main' into main
kazantsev-maksim 5ac1c58
Merge branch 'apache:main' into main
kazantsev-maksim 9ae8e23
Merge branch 'apache:main' into main
kazantsev-maksim 5ca3888
Merge branch 'apache:main' into main
kazantsev-maksim 160a817
Merge branch 'apache:main' into main
kazantsev-maksim 88fc313
Merge branch 'apache:main' into main
kazantsev-maksim e14c180
Merge branch 'apache:main' into main
kazantsev-maksim 610a885
Merge branch 'apache:main' into main
kazantsev-maksim f8acb2c
Merge branch 'apache:main' into main
kazantsev-maksim ec94897
Merge branch 'apache:main' into main
kazantsev-maksim 43405e4
Merge branch 'apache:main' into main
kazantsev-maksim 47b4915
Merge branch 'apache:main' into main
kazantsev-maksim 26e2682
Merge branch 'apache:main' into main
kazantsev-maksim 6cb5f07
Merge branch 'apache:main' into main
kazantsev-maksim ec194fb
Merge branch 'apache:main' into main
kazantsev-maksim 256fccb
Merge branch 'apache:main' into main
kazantsev-maksim 912c8f9
Merge branch 'apache:main' into main
kazantsev-maksim 561a664
Merge branch 'apache:main' into main
kazantsev-maksim d926ef4
Merge branch 'apache:main' into main
kazantsev-maksim 671412c
Merge branch 'apache:main' into main
kazantsev-maksim c9f52d1
Merge branch 'apache:main' into main
kazantsev-maksim 67f72d9
Merge branch 'apache:main' into main
kazantsev-maksim 314e594
Merge branch 'apache:main' into main
kazantsev-maksim ac8292f
Merge branch 'apache:main' into main
kazantsev-maksim c9c140e
Merge branch 'apache:main' into main
kazantsev-maksim decca58
Merge branch 'apache:main' into main
kazantsev-maksim 0919b33
Merge branch 'apache:main' into main
kazantsev-maksim 7495e21
Merge branch 'apache:main' into main
kazantsev-maksim 0a37a60
Merge branch 'apache:main' into main
kazantsev-maksim abbba84
Merge branch 'apache:main' into main
kazantsev-maksim 6020560
Merge branch 'apache:main' into main
kazantsev-maksim e2bdfb1
Merge branch 'apache:main' into main
kazantsev-maksim 3edfc33
Merge branch 'apache:main' into main
kazantsev-maksim a39e860
Merge branch 'apache:main' into main
kazantsev-maksim e88dd7b
Merge branch 'apache:main' into main
kazantsev-maksim 3e29d37
Merge branch 'apache:main' into main
kazantsev-maksim 4068359
Merge branch 'apache:main' into main
kazantsev-maksim a3cb8de
Merge branch 'apache:main' into main
kazantsev-maksim cfc751a
Feat: add empty2Null inner spark function
30a92c0
Merge branch 'main' into empty2null
kazantsev-maksim 9ba7a8e
fix pr issues
e5847ed
Merge remote-tracking branch 'origin/empty2null' into empty2null
85583e5
add tests
8422c8c
add tests
b33726f
Merge branch 'apache:main' into main
kazantsev-maksim ebbaf72
add tests
643401b
Merge branch 'main' into empty2null
kazantsev-maksim 9a71940
fix tests
63a411e
Merge branch 'main' into empty2null
kazantsev-maksim 698f7a1
Merge branch 'apache:main' into main
kazantsev-maksim c150866
fix tests
d7eda82
Merge remote-tracking branch 'origin/empty2null' into empty2null
0012e66
Merge branch 'main' into empty2null
kazantsev-maksim 18162a6
Merge branch 'apache:main' into main
kazantsev-maksim 5204448
Merge remote-tracking branch 'origin/main' into empty2null
92fbf80
fix tests
00d67c8
Merge branch 'main' into empty2null
kazantsev-maksim b561e45
Merge branch 'main' into empty2null
comphead 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
35 changes: 35 additions & 0 deletions
35
spark/src/test/spark-3.5/org/apache/spark/sql/CometSparkInternalFunctionsSuite.scala
This file contains hidden or 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,35 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| package org.apache.spark.sql | ||
|
|
||
| import org.apache.spark.sql.catalyst.expressions.Empty2Null | ||
| import org.apache.spark.sql.functions.col | ||
|
|
||
| class CometSparkInternalFunctionsSuite extends CometTestBase { | ||
|
|
||
| test("empty2null is offloaded to Comet") { | ||
| withParquetTable(Seq("", "a", null, "b").map(Tuple1(_)), "tbl") { | ||
| val df = spark | ||
| .sql("select _1 from tbl") | ||
| .select(new Column(Empty2Null(col("_1").expr)).as("p")) | ||
| checkSparkAnswerAndOperator(df) | ||
| } | ||
| } | ||
| } |
35 changes: 35 additions & 0 deletions
35
spark/src/test/spark-4.x/org/apache/spark/sql/CometSparkInternalFunctionsSuite.scala
This file contains hidden or 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,35 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| package org.apache.spark.sql | ||
|
|
||
| import org.apache.spark.sql.catalyst.expressions.Empty2Null | ||
| import org.apache.spark.sql.classic.ExpressionUtils | ||
| import org.apache.spark.sql.functions._ | ||
|
|
||
| class CometSparkInternalFunctionsSuite extends CometTestBase { | ||
|
|
||
| test("empty2null is offloaded to Comet") { | ||
| withParquetTable(Seq("", "a", null, "b").map(Tuple1(_)), "tbl") { | ||
| val df = sql("select _1 from tbl") | ||
| .select(ExpressionUtils.column(Empty2Null(ExpressionUtils.expression(col("_1")))).as("p")) | ||
| checkSparkAnswerAndOperator(df) | ||
| } | ||
| } | ||
| } |
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.
Could you add an assertion to check that the write is executed by Comet? From reading the PR description, my understanding is that we expect
empty2nullto be called during the write operation?