8000 Add table owner when create table to avoid null owner table been created by ctas query in hive by ImTangYun · Pull Request #44244 · StarRocks/starrocks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add table owner when create table to avoid null owner table been created by ctas query in hive #44244

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ImTangYun
Copy link
@ImTangYun ImTangYun commented Apr 17, 2024

…ted by ctas query

Why I'm doing:

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@ImTangYun ImTangYun requested review from a team as code owners April 17, 2024 08:06
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


tangyun seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -662,7 +675,7 @@ public Builder setHiveTableType(HiveTableType hiveTableType) {
public HiveTable build() {
return new HiveTable(id, tableName, fullSchema, resourceName, catalogName, hiveDbName, hiveTableName,
tableLocation, createTime, partitionColNames, dataColNames, properties, serdeProperties,
storageFormat, hiveTableType);
storageFormat, hiveTableType, owner);
}
}
} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

The most risky bug in this code is:
The builder pattern implementation for HiveTable is missing the handling of the owner field in its constructor call.

You can modify the code like this:

public HiveTable build() {
    return new HiveTable(id, tableName, fullSchema, resourceName, catalogName, hiveDbName, hiveTableName,
            tableLocation, createTime, partitionColNames, dataColNames, properties, serdeProperties,
            storageFormat, hiveTableType, owner); // Correctly pass `owner` to the constructor
}

Copy link
Contributor
mergify bot commented Apr 17, 2024

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

public void setOwner(String owner) {
this.owner = owner;
}

public List<AlterClause> getRollupAlterClauseList() {
return rollupAlterClauseList;
}
Copy link

Choose a reason for hiding this comment

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

Based on the provided diff, there's no direct indication of a logic or syntax error solely within the added lines. The changes introduce a new field owner along with its getter and setter methods in the class CreateTableStmt. However, without full context or understanding the broader implications these changes might have within the entire codebase, identifying the most risky bug can be speculative. Yet, considering common issues related to similar modifications, I can provide a potential concern.

The most risky bug in this code is:
Potential lack of synchronization or thread safety when setting or getting the new owner property if CreateTableStmt instances are accessed by multiple threads concurrently.

You can mitigate this by ensuring thread-safe access to the owner variable, if necessary. For instance, you could use volatile keyword if reads and writes to the owner variable are atomic and visibility is the only concern, or utilize locking mechanisms for more complex interactions. Adjusting for simple visibility issue:

private volatile String owner;

@stephen-shelby
Copy link
Contributor

can you provide some error message when you don't set owner

@@ -254,6 +256,14 @@ public String getComment() {
return comment;
}

public String getOwner() {
Copy link
Contributor

Choose a reason for hiding this comment

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

why you need an owner?

Copy link
Contributor
mergify bot commented Apr 24, 2024

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

16 similar comments
Copy link
Contributor
mergify bot commented May 6, 2024

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Dec 11, 2024

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Dec 18, 2024

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Dec 25, 2024

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Jan 2, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Jan 9, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Jan 17, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Jan 24, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Feb 2, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Feb 10, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Apr 21, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Apr 28, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented May 14, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented May 28, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Jun 5, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Copy link
Contributor
mergify bot commented Jun 17, 2025

⚠️ The sha of the head commit of this PR conflicts with #44242. Mergify cannot evaluate rules on this PR. ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0