-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support of the spark 3.1, updated Layerfile to test other versi…
…ons of S2 and spark Summary: - Added support of the spark 3.1 and deleted support of the 2.3 and 2.4 - Deleted testing of spark 2.3 and spark 2.4 - Deleted testing of the 6.7 and 6.8 SingleStore versions - Added testing of the 7.5 SingleStore version - Added testing of the 3.1 spark version - Changed the way sbt is installed in CI (Bintray doesn't work. I guess that it is connected to https://www.infoq.com/news/2021/02/jfrog-jcenter-bintray-closure/ ) **Design doc/spec**: **Docs impact**: none Test Plan: https://webapp.io/memsql/commits?query=%22Adalbert+Makarovych%22+repo%3Asinglestore-spark-connector+id%3A16 Reviewers: iblinov-ua, vtkachuk-ua, carl Reviewed By: iblinov-ua Subscribers: engineering-list JIRA Issues: PLAT-5757 Differential Revision: https://grizzly.internal.memcompute.com/D50927
- Loading branch information
1 parent
5c091bc
commit b56a7c3
Showing
32 changed files
with
501 additions
and
467 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
.idea/runConfigurations/Test_Spark_2_3.xml → .idea/runConfigurations/Test_Spark_3_1.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
.idea/runConfigurations/ensure_test_memsql_cluster_6_8.xml
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/main/scala-sparkv2/com/singlestore/spark/AggregateExpressionFilter.scala
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/scala-sparkv2/com/singlestore/spark/BitAggregateExpressionExtractor.scala
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/main/scala-sparkv2/com/singlestore/spark/JoinExtractor.scala
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/main/scala-sparkv2/com/singlestore/spark/PlanToCommentSQL.scala
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
src/main/scala-sparkv2/com/singlestore/spark/VersionSpecificExpressionGen.scala
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...n/scala-sparkv3.0/com/singlestore/spark/VersionSpecificAggregateExpressionExtractor.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,43 @@ | ||
package com.singlestore.spark | ||
|
||
import com.singlestore.spark.SQLGen.{ExpressionExtractor, SQLGenContext, Statement} | ||
import com.singlestore.spark.ExpressionGen.aggregateWithFilter | ||
import org.apache.spark.sql.catalyst.expressions.Literal | ||
import org.apache.spark.sql.catalyst.expressions.aggregate.{ | ||
AggregateFunction, | ||
First, | ||
Last, | ||
StddevPop, | ||
StddevSamp, | ||
VariancePop, | ||
VarianceSamp | ||
} | ||
import org.apache.spark.sql.types.BooleanType | ||
|
||
case class VersionSpecificAggregateExpressionExtractor(expressionExtractor: ExpressionExtractor, | ||
context: SQLGenContext, | ||
filter: Option[SQLGen.Joinable]) { | ||
def unapply(f: AggregateFunction): Option[Statement] = { | ||
f match { | ||
// CentralMomentAgg.scala | ||
case StddevPop(expressionExtractor(child)) => | ||
Some(aggregateWithFilter("STDDEV_POP", child, filter)) | ||
case StddevSamp(expressionExtractor(child)) => | ||
Some(aggregateWithFilter("STDDEV_SAMP", child, filter)) | ||
case VariancePop(expressionExtractor(child)) => | ||
Some(aggregateWithFilter("VAR_POP", child, filter)) | ||
case VarianceSamp(expressionExtractor(child)) => | ||
Some(aggregateWithFilter("VAR_SAMP", child, filter)) | ||
|
||
// First.scala | ||
case First(expressionExtractor(child), Literal(false, BooleanType)) => | ||
Some(aggregateWithFilter("ANY_VALUE", child, filter)) | ||
|
||
// Last.scala | ||
case Last(expressionExtractor(child), Literal(false, BooleanType)) => | ||
Some(aggregateWithFilter("ANY_VALUE", child, filter)) | ||
|
||
case _ => None | ||
} | ||
} | ||
} |
Oops, something went wrong.