This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SUBMARINE-679. Spark Security Plugin Support Spark-3.0.1
### What is this PR for? Submarine Spark Security Plugin Support Spark-3.x ### What type of PR is it? [Improvement | Feature] ### What is the Jira issue? [SUBMARINE-679](https://issues.apache.org/jira/browse/SUBMARINE-679) ### Questions: * Does this need documentation? YES Author: atovk <[email protected]> Closes #463 from atovk/SUBMARINE-679 and squashes the following commits: 56742a9 [atovk] fit scala-style check 90788fa [atovk] SubmarineSqlParser class Compatible for spark2.x and spark3.x b1309f9 [atovk] clean Dependency for test case in profiles hadoop-2.9 (hadoop3.x untested) 27eb9c2 [atovk] add doc available profiles spark-3.0 ba296c6 [atovk] fit test case in spark2.x and spark3.x eee31b5 [atovk] fix ranger in spark3.x subquery Permission filter e002c3d [atovk] fit spark 3.0 Dependency version 138f729 [atovk] add Test submarine spark security with spark 3.0 276af6c [atovk] SUBMARINE-679. Spark Security Plugin Support Spark-3.0.1
- Loading branch information
Showing
20 changed files
with
491 additions
and
53 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
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
34 changes: 34 additions & 0 deletions
34
...ecurity/spark-2/src/main/scala/org/apache/submarine/spark/compatible/CompatibleFunc.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,34 @@ | ||
/* | ||
* 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.submarine.spark.compatible | ||
|
||
import org.apache.spark.sql.catalyst.analysis.UnresolvedRelation | ||
import org.apache.spark.sql.execution.command.{AnalyzeColumnCommand, SetDatabaseCommand, ShowDatabasesCommand} | ||
|
||
object CompatibleFunc { | ||
|
||
def getPattern(child: ShowDatabasesCommand) = child.databasePattern | ||
|
||
def getCatLogName(s: SetDatabaseCommand) = s.databaseName | ||
|
||
def analyzeColumnName(column: AnalyzeColumnCommand) = column.columnNames | ||
|
||
def tableIdentifier(u: UnresolvedRelation) = u.tableIdentifier | ||
} |
34 changes: 34 additions & 0 deletions
34
...ity/spark-2/src/main/scala/org/apache/submarine/spark/compatible/SubqueryCompatible.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,34 @@ | ||
/* | ||
* 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.submarine.spark.compatible | ||
|
||
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Subquery} | ||
|
||
case class SubqueryCompatible(child: LogicalPlan, correlated: Boolean= false) { | ||
Subquery(child) | ||
} | ||
|
||
object SubqueryCompatible { | ||
// def apply(child: LogicalPlan, correlated: Boolean= false) = Subquery(child) | ||
def unapply(subquery: Subquery): Option[LogicalPlan] = Subquery.unapply(subquery) | ||
} | ||
|
||
|
||
|
33 changes: 33 additions & 0 deletions
33
...rk-2/src/main/scala/org/apache/submarine/spark/compatible/command/CompatibleCommand.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,33 @@ | ||
/* | ||
* 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.submarine.spark.compatible | ||
|
||
import org.apache.spark.sql.execution.command.{PersistedView, SetDatabaseCommand, ShowDatabasesCommand} | ||
|
||
package object CompatibleCommand { | ||
|
||
type ShowDatabasesCommandCompatible = ShowDatabasesCommand | ||
type SetDatabaseCommandCompatible = SetDatabaseCommand | ||
|
||
} | ||
|
||
object PersistedViewCompatible { | ||
val obj: PersistedView.type = PersistedView | ||
} |
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
36 changes: 36 additions & 0 deletions
36
...ecurity/spark-3/src/main/scala/org/apache/submarine/spark/compatible/CompatibleFunc.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,36 @@ | ||
/* | ||
* 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.submarine.spark.compatible | ||
|
||
import org.apache.spark.sql.catalyst.TableIdentifier | ||
import org.apache.spark.sql.catalyst.analysis.UnresolvedRelation | ||
import org.apache.spark.sql.catalyst.plans.logical.{SetCatalogAndNamespace, ShowNamespaces} | ||
import org.apache.spark.sql.execution.command.AnalyzeColumnCommand | ||
|
||
object CompatibleFunc { | ||
|
||
def getPattern(child: ShowNamespaces) = child.pattern | ||
|
||
def getCatLogName(s: SetCatalogAndNamespace) = s.catalogName | ||
|
||
def analyzeColumnName(column: AnalyzeColumnCommand) = column.columnNames.get | ||
|
||
def tableIdentifier(u: UnresolvedRelation) = TableIdentifier.apply(u.tableName) | ||
} |
29 changes: 29 additions & 0 deletions
29
...ity/spark-3/src/main/scala/org/apache/submarine/spark/compatible/SubqueryCompatible.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,29 @@ | ||
/* | ||
* 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.submarine.spark.compatible | ||
|
||
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Subquery} | ||
|
||
object SubqueryCompatible { | ||
def apply(child: LogicalPlan, correlated: Boolean) = Subquery(child, correlated) | ||
def unapply(subquery: Subquery): Option[(LogicalPlan, Boolean)] = Subquery.unapply(subquery) | ||
} | ||
|
||
|
36 changes: 36 additions & 0 deletions
36
...rk-3/src/main/scala/org/apache/submarine/spark/compatible/command/CompatibleCommand.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,36 @@ | ||
/* | ||
* 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.submarine.spark.compatible | ||
|
||
import org.apache.spark.sql.catalyst.analysis.PersistedView | ||
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, SetCatalogAndNamespace, ShowNamespaces, Subquery} | ||
|
||
|
||
package object CompatibleCommand { | ||
|
||
type ShowDatabasesCommandCompatible = ShowNamespaces | ||
type SetDatabaseCommandCompatible = SetCatalogAndNamespace | ||
} | ||
|
||
object PersistedViewCompatible { | ||
val obj: PersistedView.type = PersistedView | ||
} | ||
|
||
|
Oops, something went wrong.