-
Notifications
You must be signed in to change notification settings - Fork 0
fix mistakes #9
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
fix mistakes #9
Conversation
@@ -297,7 +297,7 @@ class ResolveSessionCatalog( | |||
assertNoNullTypeInSchema(c.asSelect.schema) | |||
} | |||
val (storageFormat, provider) = getStorageFormatAndProvider( | |||
c.provider, c.options, c.location, c.serde, ctas = false) | |||
c.provider, c.options, c.location, c.serde, ctas = true) |
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.
this is CTAS.
// rowStorage used to determine CatalogStorageFormat.serde and | ||
// CatalogStorageFormat.properties in STORED AS clause. | ||
val serdeInfo = getSerdeInfo(ctx.rowFormat.asScala, ctx.createFileFormat.asScala, ctx) | ||
// TODO: Do not skip serde check for CREATE TABLE LIKE. |
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.
CREATE TABLE LIKE has several inconsistencies with CREATE TABLE, I'll keep them unchanged here and fix them later.
@@ -603,7 +613,8 @@ class SparkSqlAstBuilder extends AstBuilder { | |||
*/ | |||
override def visitInsertOverwriteHiveDir( | |||
ctx: InsertOverwriteHiveDirContext): InsertDirParams = withOrigin(ctx) { | |||
val serdeInfo = getSerdeInfo(Seq(ctx.rowFormat), Seq(ctx.createFileFormat), ctx) | |||
val serdeInfo = getSerdeInfo( | |||
Option(ctx.rowFormat).toSeq, Option(ctx.createFileFormat).toSeq, ctx) |
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.
to be null safe.
@cloud-fan, the reason why the commands in SparkSqlParser like I would be fine reverting your changes for those commands. I assumed that you had tested your changes the last time and had made sure that everything was passing. Did you test your changes this time? |
if (provider.isDefined && serdeInfo.isDefined) { | ||
operationNotAllowed(s"CREATE TABLE LIKE ... USING ... ${serdeInfo.get.describe}", ctx) | ||
} | ||
|
||
// TODO: remove this restriction as it seems unnecessary. |
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.
If you intend to change this later, then please file an issue for it rather than adding a TODO here. This PR should preserve existing behavior.
The current PR diverges from my previous local branch and is unfortunately not fully tested (I did run several DDL tests locally before submitting this PR). Regarding CREATE TABLE LIKE, I've created a JIRA to track it: https://issues.apache.org/jira/browse/SPARK-33546 . |
No description provided.