Skip to content
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

[KYUUBI #307]GetCatalogs supports DSv2 and keeps its backward compatibility #307

Merged
merged 7 commits into from
Jan 29, 2021

Conversation

yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Jan 28, 2021

yaooqinn Closes%20#307 282 24 7 Feature ❨?❩

Please add issue ID here?

Fixes #307

Why are the changes needed?

GetCatalogs supports DSv2 and keeps its backward compatibility

Test Plan:

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate
    image

  • Run test locally before make a pull request

@yaooqinn yaooqinn self-assigned this Jan 28, 2021
@yaooqinn yaooqinn added the kind:feature Feature request label Jan 28, 2021
@yaooqinn yaooqinn changed the title GetCatalogs supports DSv2 [KYUUBI #307]GetCatalogs supports DSv2 Jan 28, 2021
@yaooqinn
Copy link
Member Author

cc @ulysses-you @turboFei @pan3793

@yaooqinn yaooqinn changed the title [KYUUBI #307]GetCatalogs supports DSv2 [KYUUBI #307]GetCatalogs supports DSv2 and keeps its backward compatibility Jan 28, 2021
@turboFei
Copy link
Member

turboFei commented Jan 28, 2021

Is it possible that create a util class for each in-compatible method with different spark version.

For example:

spark-3.0

<spark.version>3.0.0</spark.version>
<src.version>3.0</src.version>

source code path: /v3.0/src/main

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>add-sources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>v${src.version}/src/main/scala</source>
                            <source>v${src.version}/src/main/java</source>
                        </sources>
                    </configuration>
                </execution>
                <execution>
                    <id>add-scala-test-sources</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>add-test-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>v${src.version}/src/test/scala</source>
                            <source>v${src.version}/src/test/java</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

@codecov
Copy link

codecov bot commented Jan 28, 2021

Codecov Report

Merging #307 (59c9d0c) into master (05c64fe) will decrease coverage by 0.11%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #307      +/-   ##
==========================================
- Coverage   79.62%   79.51%   -0.12%     
==========================================
  Files          95       98       +3     
  Lines        3402     3432      +30     
  Branches      399      404       +5     
==========================================
+ Hits         2709     2729      +20     
- Misses        493      497       +4     
- Partials      200      206       +6     
Impacted Files Coverage Δ
...he/kyuubi/engine/spark/operation/GetCatalogs.scala 83.33% <50.00%> (-16.67%) ⬇️
...rg/apache/kyuubi/engine/spark/shim/Shim_v2_4.scala 50.00% <50.00%> (ø)
...rg/apache/kyuubi/engine/spark/shim/SparkShim.scala 66.66% <66.66%> (ø)
.../kyuubi/engine/spark/operation/GetTableTypes.scala 100.00% <100.00%> (ø)
...rg/apache/kyuubi/engine/spark/shim/Shim_v3_0.scala 100.00% <100.00%> (ø)
...org/apache/kyuubi/ha/server/EmbeddedZkServer.scala 90.00% <0.00%> (-5.00%) ⬇️

@pan3793
Copy link
Member

pan3793 commented Jan 28, 2021

Is it possible that create a util class for each in-compatible method with different spark version.

I recommend introduce a SparkShim rather than create different source folders.

@yaooqinn
Copy link
Member Author

Is it possible that create a util class for each in-compatible method with different spark version.

I recommend introduce a SparkShim rather than create different source folders.

I prefer this way

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scan Summary

Tool Critical High Medium Low Status
Dependency Scan (java) 0 2 5 0
Security Audit for Infrastructure 0 0 0 0
Class File Analyzer 0 6 0 0
Scala Security Audit 0 6 0 0
Shell Script Analysis 0 0 0 0
Java Source Analyzer 0 0 0 1

Recommendation

Please review the findings from Code scanning alerts before approving this pull request. You can also configure the build rules or add suppressions to customize this bot 👍

@github-actions github-actions bot added the kind:security CVE-related label Jan 28, 2021
@yaooqinn yaooqinn added this to Review in progress in Support Spark DSv2 In Metadata Jan 28, 2021
@yaooqinn
Copy link
Member Author

I add a screenshot in the PR desc, is that what you expected @pan3793


class Shim_v2_4 extends SparkShim {
override def getCatalogs(ss: SparkSession): Seq[Row] = {
Seq(Row("spark_catalog"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Spark v2.4 have the concept of catalog? Maybe here we shall return "", anyway we can check this later when supporting Spark v2.4

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scan Summary

Tool Critical High Medium Low Status
Dependency Scan (java) 0 2 5 0
Shell Script Analysis 0 0 0 0
Class File Analyzer 0 6 0 0
Security Audit for Infrastructure 0 0 0 0
Java Source Analyzer 0 0 0 1
Scala Security Audit 0 6 0 0

Recommendation

Please review the findings from Code scanning alerts before approving this pull request. You can also configure the build rules or add suppressions to customize this bot 👍

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add a screenshot in the PR desc, is that what you expected @pan3793

Nice! LGTM, just few comments.

pom.xml Outdated Show resolved Hide resolved
@yaooqinn yaooqinn merged commit efdd9fa into master Jan 29, 2021
Support Spark DSv2 In Metadata automation moved this from Review in progress to Done Jan 29, 2021
@yaooqinn yaooqinn deleted the getcatalogs branch January 29, 2021 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature Feature request kind:security CVE-related
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants