-
Notifications
You must be signed in to change notification settings - Fork 931
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 #5529][AUTHZ] Support create table command for Delta Lake #5530
Conversation
Nice! cc @bowenliang123 and @AngersZhuuuu |
Cool, let's bring Ranger authorisation to Delta in Kyuubi Authz ! |
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.
LGTM.
Would be more clare if we reorder the test cases in the order for the non-partitioned table, the partitioned table, and then the create/replace table. Or just separated into separated ut.
delta lake also supports creating a table at a path -- Create or replace table with path
CREATE OR REPLACE TABLE delta.`/tmp/delta/people10m` (
id INT,
firstName STRING,
middleName STRING,
lastName STRING,
gender STRING,
birthDate TIMESTAMP,
ssn STRING,
salary INT
) USING DELTA Shall we also add UTs for this case? |
Path-based tables are supported in Authz now. No path based policies (eg. HDFS service def) of Ranger are supported. |
Thanks, updated. |
Does Delta Lake have an option for the globally disabled path-based table, similar to how |
@AngersZhuuuu is currently working one the path/uri authorization What's the plan of CREATE OR REPLACE TABLE delta. |
https://github.com/delta-io/delta/blob/8639c411890a5c77386f04e2282fcf4caa401eff/spark/src/test/scala/org/apache/spark/sql/delta/DeltaDDLUsingPathSuite.scala#L125 |
|
thank you for your input. @zml1206 |
Codecov Report
@@ Coverage Diff @@
## master #5530 +/- ##
============================================
- Coverage 61.35% 61.32% -0.03%
Complexity 23 23
============================================
Files 598 598
Lines 34260 34254 -6
Branches 4489 4488 -1
============================================
- Hits 21019 21007 -12
- Misses 11113 11118 +5
- Partials 2128 2129 +1 see 15 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
thanks, merging to master(v1.9.0). |
interceptContains[AccessControlException] { | ||
doAs(someone, sql(createNonPartitionTableSql)) | ||
}(s"does not have [create] privilege on [$namespace1/$table1]") | ||
doAs(admin, createNonPartitionTableSql) |
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.
Hi @zml1206, this line has an issue that it does not trigger a sql operation.
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.
Yes, I'll fix it right away, thanks.
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.
Fix in #5597
interceptContains[AccessControlException] { | ||
doAs(someone, sql(createPartitionTableSql)) | ||
}(s"does not have [create] privilege on [$namespace1/$table2]") | ||
doAs(admin, createPartitionTableSql) |
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.
ditto
interceptContains[AccessControlException] { | ||
doAs(someone, sql(createOrReplaceTableSql)) | ||
}(s"does not have [create] privilege on [$namespace1/$table1]") | ||
doAs(admin, createOrReplaceTableSql) |
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.
ditto
Why are the changes needed?
To close #5529.
Support create table command for Delta Lake in Authz.
https://docs.delta.io/latest/delta-batch.html#create-a-table
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request
Was this patch authored or co-authored using generative AI tooling?
No.