forked from Kyligence/spark
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-37867][SQL] Compile aggregate functions of build-in JDBC dialect
### What changes were proposed in this pull request? DS V2 translate a lot of standard aggregate functions. Currently, only H2Dialect compile these standard aggregate functions. This PR compile these standard aggregate functions for other build-in JDBC dialect. ### Why are the changes needed? Make build-in JDBC dialect support complete aggregate push-down. ### Does this PR introduce _any_ user-facing change? 'Yes'. Users could use complete aggregate push-down with build-in JDBC dialect. ### How was this patch tested? New tests. Closes apache#35166 from beliefer/SPARK-37867. Authored-by: Jiaan Geng <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information
Showing
14 changed files
with
490 additions
and
38 deletions.
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
44 changes: 44 additions & 0 deletions
44
...tion-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala
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,44 @@ | ||
/* | ||
* 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.jdbc.v2 | ||
|
||
import java.sql.Connection | ||
|
||
import org.apache.spark.sql.jdbc.DockerJDBCIntegrationSuite | ||
|
||
abstract class DockerJDBCIntegrationV2Suite extends DockerJDBCIntegrationSuite { | ||
|
||
/** | ||
* Prepare databases and tables for testing. | ||
*/ | ||
override def dataPreparation(connection: Connection): Unit = { | ||
tablePreparation(connection) | ||
connection.prepareStatement("INSERT INTO employee VALUES (1, 'amy', 10000, 1000)") | ||
.executeUpdate() | ||
connection.prepareStatement("INSERT INTO employee VALUES (2, 'alex', 12000, 1200)") | ||
.executeUpdate() | ||
connection.prepareStatement("INSERT INTO employee VALUES (1, 'cathy', 9000, 1200)") | ||
.executeUpdate() | ||
connection.prepareStatement("INSERT INTO employee VALUES (2, 'david', 10000, 1300)") | ||
.executeUpdate() | ||
connection.prepareStatement("INSERT INTO employee VALUES (6, 'jen', 12000, 1200)") | ||
.executeUpdate() | ||
} | ||
|
||
def tablePreparation(connection: Connection): Unit | ||
} |
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
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
Oops, something went wrong.