Skip to content

HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… #5804

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 3 commits into
base: master
Choose a base branch
from

Conversation

saihemanth-cloudera
Copy link
Contributor

…port JDK17 + JDO6.0

For Hive to support JDK17 + JDO6.0, select/update/delete queries of the table are failing to fetch column information of the table. The DataNucleus6.0 is unable to map the Mcolumn Descriptor definition to the underlying table schema due to the presence of CLOB type field for the join condition in the package.jdo file. This patch addresses the issue by avoiding the CLOB column in the join condition.

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

…port JDK17 + JDO6.0

For Hive to support JDK17 + JDO6.0, select/update/delete queries of the table are failing
to fetch column information of the table. The DataNucleus6.0 is unable to map the Mcolumn
Descriptor definition to the underlying table schema due to the presence of CLOB type field
for the join condition in the package.jdo file. This patch addresses the issue by avoiding
the CLOB column in the join condition.
Copy link
Member

@dengzhhu653 dengzhhu653 left a comment

Choose a reason for hiding this comment

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

+1 pending tests

Copy link

sonarqubecloud bot commented May 9, 2025

}

public List<MFieldSchema> getCols() {
return cols;
List<MFieldSchema> schemas = new ArrayList<>();
if (getColumns() != null) {
Copy link
Member

@deniskuzZ deniskuzZ May 9, 2025

Choose a reason for hiding this comment

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

Wonder why we need the double-conversion? Why not store the List<MFieldSchema> cols passed through the constructor?

private List<MFieldSchema> cols;
private List<MColumn> fields;

public MColumnDescriptor(List<MFieldSchema> cols) {
this.cols = cols;
columns = new ArrayList<>(cols.size());
for (MFieldSchema schema : cols) {
Copy link
Member

@deniskuzZ deniskuzZ May 9, 2025

Choose a reason for hiding this comment

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

minor: why not use stream API?

this.fields = cols.stream().map(schema -> 
    new MColumn(schema.getName(), schema.getType(), schema.getComment())
  .collect(Collectors.toList())

}
}

public List<MColumn> getColumns() {
Copy link
Member

Choose a reason for hiding this comment

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

Could we come up with a better naming to distinguish 2: getColumns() & getCols()?
keep getCols(), but rename getColumns() to getFields or similar

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.

4 participants