-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Spark]Refactor Spark project structure to combine both Dsv1 connector and kernel backed Dsv2 connector #5320
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
base: master
Are you sure you want to change the base?
Changes from all commits
e6e374f
9560950
8b9fda1
4f45983
d6dc7ef
3a6472b
b55bfaa
29a9dbe
5cbf64f
9a6acdd
f8d4862
6c7c972
565f9cb
74a1f5c
c6c306d
dbf686b
2929d72
642a42a
e485cda
f6ef579
5f0dbc8
812ba1d
7dd8d18
1658b8f
743ca99
33f484e
6f833ef
5c05ad4
fb98c0c
8c4dd7e
a0af2a9
57312d9
e639b18
92b6326
1238ef8
021582e
89206cf
ad155d1
7864c77
8716b18
86c0186
3a19590
a000aa8
163b123
a63fd0d
680787e
6c3f89b
98295d3
6fea63c
ba9f416
42d09ae
94dcf97
4f07eb9
758d35e
322cb0b
573ed9e
85173cc
b52d0a8
7860a01
6650ff7
68802d9
4f48696
3479837
9a039ab
43ced15
64d5723
8cceaed
8afe5fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (2021) The Delta Lake Project Authors. | ||
* | ||
* Licensed 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.delta.catalog; | ||
|
||
/** | ||
* Delta Catalog implementation that can delegate to both V1 and V2 implementations. | ||
* This class sits in delta-spark (combined) module and can access: | ||
* - V1: org.apache.spark.sql.delta.* (full version with DeltaLog) | ||
* - V2: io.delta.kernel.spark.* | ||
*/ | ||
public class DeltaCatalog extends AbstractDeltaCatalog { | ||
|
||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (2021) The Delta Lake Project Authors. | ||
* | ||
* Licensed 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 io.delta.sql | ||
|
||
import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan | ||
import org.apache.spark.sql.catalyst.rules.Rule | ||
|
||
/** | ||
* Delta Spark Session Extension that can register both V1 and V2 implementations. | ||
* This class sits in delta-spark (combined) module and can access: | ||
* - V1: org.apache.spark.sql.delta.* (full version with DeltaLog) | ||
* - V2: io.delta.kernel.spark.* | ||
*/ | ||
class DeltaSparkSessionExtension extends AbstractDeltaSparkSessionExtension { | ||
|
||
/** | ||
* NoOpRule for binary compatibility with Delta 3.3.0 | ||
* This class must remain here to satisfy MiMa checks | ||
*/ | ||
class NoOpRule extends Rule[LogicalPlan] { | ||
override def apply(plan: LogicalPlan): LogicalPlan = plan | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,8 @@ import org.apache.spark.sql.internal.SQLConf | |
* | ||
* @since 0.4.0 | ||
*/ | ||
class DeltaSparkSessionExtension extends (SparkSessionExtensions => Unit) { | ||
class LegacyDeltaSparkSessionExtension extends AbstractDeltaSparkSessionExtension | ||
class AbstractDeltaSparkSessionExtension extends (SparkSessionExtensions => Unit) { | ||
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. Let's add a blank line between the two classes. |
||
override def apply(extensions: SparkSessionExtensions): Unit = { | ||
extensions.injectParser { (_, parser) => | ||
new DeltaSqlParser(parser) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,9 @@ import org.apache.spark.sql.types.{IntegerType, StructField, StructType} | |
* A Catalog extension which can properly handle the interaction between the HiveMetaStore and | ||
* Delta tables. It delegates all operations DataSources other than Delta to the SparkCatalog. | ||
*/ | ||
class DeltaCatalog extends DelegatingCatalogExtension | ||
class LegacyDeltaCatalog extends AbstractDeltaCatalog | ||
|
||
class AbstractDeltaCatalog extends DelegatingCatalogExtension | ||
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. Let's add comments |
||
with StagingTableCatalog | ||
with SupportsPathIdentifier | ||
with DeltaLogging { | ||
|
@@ -933,7 +935,7 @@ class DeltaCatalog extends DelegatingCatalogExtension | |
* A trait for handling table access through delta.`/some/path`. This is a stop-gap solution | ||
* until PathIdentifiers are implemented in Apache Spark. | ||
*/ | ||
trait SupportsPathIdentifier extends TableCatalog { self: DeltaCatalog => | ||
trait SupportsPathIdentifier extends TableCatalog { self: AbstractDeltaCatalog => | ||
|
||
private def supportSQLOnFile: Boolean = spark.sessionState.conf.runSQLonFile | ||
|
||
|
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.
Shall we add a README.md under spark-combined?
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.
Also, shall we call it
spark-unified
instead ofspark-combined
?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.
Or, we can have