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

Add support for INSERT OVERWRITE #116

Merged

Conversation

becketqin
Copy link
Collaborator

The patch simply added support for INSERT OVERWRITE.

We should also support CREATE TABLE AS SELECT (CTAS). However, the org.apache.flink.table.api.bridge.java.StreamStatementSet does not support CTAS yet. We need to make change to the OSS Flink first.

@venkata91
Copy link

Thanks for the fix @becketqin. Won't we have similar issues with other DDL commands like DROP, CREATE, ALTER etc? WDYT?

Copy link

@xinyuiscool xinyuiscool left a comment

Choose a reason for hiding this comment

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

LGTM!

@venkata91
Copy link

Comment referring to INSERT INTO in SqlTransform should also be fixed?

@@ -231,7 +238,7 @@ private static ExpectedResultTable readRowsFromFile(String path, boolean hasHead
}
}

interface SerializableDynamicTableSink extends DynamicTableSink, Serializable {
interface SerializableDynamicTableSink extends DynamicTableSink, SupportsOverwrite, Serializable {

Choose a reason for hiding this comment

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

Should the SerializableDynamicTableSink also implement SupportsPartitioning to allow for partitioning?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The purpose of the test is to make sure we allow all the statements starting with INSERT. So as long as both INSERT INTO and INSERT OVERWRITE got passed to the TableEnv, the logic we want to test is verified. Therefore, we don't need to cover all the possible syntaxes of INSERT because SqlPTransform does not deal with them except pass them through.

@becketqin becketqin force-pushed the sql_ptransform_support_insert_overwrite branch 3 times, most recently from 200393d to 1e301e0 Compare April 24, 2024 20:40
@venkata91
Copy link

Thanks for the fix @becketqin. Won't we have similar issues with other DDL commands like DROP, CREATE, ALTER etc? WDYT?

In our offline conversation, we finally concluded that we will add support for all the DDLs (Yeah, I guess it does not hurt to support all the DDLs. I'll update the patch.). Are you planning to add them as part of them same patch?

@becketqin
Copy link
Collaborator Author

Had a discussion with @venkata91 offline again.

What is not supported with this patch is the non-computing DDL only statements. After checking the code a bit more, I found supporting that is somewhat changing the design principle of the Flink runner. After all, the non-computing statements has nothing to do with Beam. Users should probably just use TableEnv to execute the statements, instead of run the statements through the Beam pipeline which is a detour. So we will keep the patch as is.

@becketqin becketqin force-pushed the sql_ptransform_support_insert_overwrite branch from 1e301e0 to ef27b46 Compare April 25, 2024 02:46
@github-actions github-actions bot added the build label Apr 25, 2024
Copy link

@venkata91 venkata91 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks Becket for adding this improvement!

@venkata91
Copy link

Had a discussion with @venkata91 offline again.

What is not supported with this patch is the non-computing DDL only statements. After checking the code a bit more, I found supporting that is somewhat changing the design principle of the Flink runner. After all, the non-computing statements has nothing to do with Beam. Users should probably just use TableEnv to execute the statements, instead of run the statements through the Beam pipeline which is a detour. So we will keep the patch as is.

Agreed! We can revisit this if needed in the future.

@becketqin becketqin merged commit 1de86e6 into linkedin:li_trunk Apr 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants