You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "saihemanth-cloudera (via GitHub)" <gi...@apache.org> on 2025/05/06 22:34:05 UTC

[PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

saihemanth-cloudera opened a new pull request, #5804:
URL: https://github.com/apache/hive/pull/5804

   …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.
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2858287306

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2084485270


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -364,32 +380,13 @@
       </field>
     </class>
 
-    <class name="MColumnDescriptor" identity-type="datastore" table="CDS" detachable="true">
-      <datastore-identity>
-        <column name="CD_ID"/>
-      </datastore-identity>
-      <field name="cols" persistence-modifier="persistent" table="COLUMNS_V2">
-        <collection element-type="MFieldSchema" dependent-element="true" />
-        <join>
-          <primary-key name="SQL110922153006740">
-            <column name="CD_ID"/>
-            <column name="COLUMN_NAME"/>
-          </primary-key>
-          <column name="CD_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="name">
-              <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="type">
-              <column name="TYPE_NAME" length="32672" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="comment">
-              <column name="COMMENT" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-            </field>
-          </embedded>
-        </element>
+    <class name="MColumnDescriptor" identity-type="application" table="CDS" detachable="true">
+      <field name="id" primary-key="true" value-strategy="native">
+        <column name="CD_ID" jdbc-type="BIGINT" />
+      </field>
+      <field name="columns" mapped-by="cd">
+        <order column="INTEGER_IDX"/>
+        <collection element-type="MColumn" dependent-element="true" />

Review Comment:
   I referred to this document to know how JDO with collections works.
   https://www.datanucleus.org/products/accessplatform_4_1/jdo/orm/one_to_many_collection.html



##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -115,6 +115,22 @@
       </field>
     </class>
 
+    <class name="MColumn" identity-type="application" table="COLUMNS_V2" detachable="true" objectid-class="MColumn$PK">

Review Comment:
   I understand we need `objectid-class` because the PK is composed of two columns.
   https://www.datanucleus.org/products/accessplatform_4_2/jdo/application_identity.html#primarykey



##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -364,32 +380,13 @@
       </field>
     </class>
 
-    <class name="MColumnDescriptor" identity-type="datastore" table="CDS" detachable="true">
-      <datastore-identity>
-        <column name="CD_ID"/>
-      </datastore-identity>
-      <field name="cols" persistence-modifier="persistent" table="COLUMNS_V2">
-        <collection element-type="MFieldSchema" dependent-element="true" />
-        <join>
-          <primary-key name="SQL110922153006740">
-            <column name="CD_ID"/>
-            <column name="COLUMN_NAME"/>
-          </primary-key>
-          <column name="CD_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="name">
-              <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="type">
-              <column name="TYPE_NAME" length="32672" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="comment">
-              <column name="COMMENT" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-            </field>
-          </embedded>
-        </element>
+    <class name="MColumnDescriptor" identity-type="application" table="CDS" detachable="true">
+      <field name="id" primary-key="true" value-strategy="native">

Review Comment:
   The native strategy sounds good, though I'm not a specialist of JDO.
   https://www.datanucleus.org/products/accessplatform_4_2/jdo/value_generation.html



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, why do we need this? if DataNucleus can resolve this, then why do we need to add conversion logic in `getCols()`  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2087230529


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   @dengzhhu653, but the `getCols()` is executed in the loop in application code leading to unnecessary repetitive fields transform to List<MFieldSchema>.  Maybe worth changing to `getFields().size()`
   
   example
   ````
   for (MColumnDescriptor cd : cdIdToColumnDescriptor.values()) {
       rowCount += cd.getCols().size();
   }
   ````
   also `sd.getCD().getCols() == null` now would always be false



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2088293516


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   My concern here is not about `fields`, but their transformed representation returned by `getCols()`.  please check https://github.com/apache/hive/pull/5804#discussion_r2087230529 comment



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2896624519

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102998900


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   weird, see https://www.datanucleus.org/products/accessplatform_4_1/jdo/fields_properties.html



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081198193


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {

Review Comment:
   minor: why not use stream API?
   ````
   columns = cols.stream().map(schema -> 
       new MColumn(schema.getName(), schema.getType(), schema.getComment())
     .collect(Collectors.toList())
   ````
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081175368


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   Wonder why we need the double-conversion? Why not store the `List<MFieldSchema> cols` passed through the constructor? 
   ````
   private List<MColumn> columns;
   private List<MFieldSchema> fieldSchemas;
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085514269


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   i understand that, but why do you need to reconstruct the `getCols() ` representation?
   ````
     private List<MColumn> fields;
     private long id;
   
     private List<MFieldSchema> cols;
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       
       this.fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
               .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
        return cols
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2087230529


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   @dengzhhu653, but the `getCols()` is executed in the loop in application code leading to unnecessary repetitive fields transform to `List<MFieldSchema>`.  Maybe worth changing to `getFields().size()`
   
   example
   ````
   for (MColumnDescriptor cd : cdIdToColumnDescriptor.values()) {
       rowCount += cd.getCols().size();
   }
   ````
   also `sd.getCD().getCols() == null` now would always be false



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081175368


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   Wonder why we need the double-conversion? Why not store the `List<MFieldSchema> cols` passed through the constructor? 
   ````
   private List<MColumn> fields;
   private List<MFieldSchema> cols;
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085544329


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   I understand this, but why do we need to reconstruct `getCols()` representations?
   ````
   public class MColumnDescriptor {
   
     private List<MFieldSchema> cols;
     
     private List<MColumn> fields;
     private long id;
   
     public MColumnDescriptor() {}
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
         .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
       if (cols != null) {
         return cols;
       }
       cols = new ArrayList<>();
       if (fields != null) {
         cols = getFields().stream().map(column ->
             new MFieldSchema(column.getName(), column.getType(), column.getComment()))
           .collect(Collectors.toList());
       }
       return cols;
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085544329


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   I understand this, but why do we need to reconstruct the representations?
   ````
   public class MColumnDescriptor {
   
     private List<MFieldSchema> cols;
     
     private List<MColumn> fields;
     private long id;
   
     public MColumnDescriptor() {}
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
         .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
       if (cols != null) {
         return cols;
       }
       cols = new ArrayList<>();
       if (fields != null) {
         cols = getFields().stream().map(column ->
             new MFieldSchema(column.getName(), column.getType(), column.getComment()))
           .collect(Collectors.toList());
       }
       return cols;
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, could it be simplified to just
   ````
   <field name="columns" persistence-modifier="none">
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn merged PR #5804:
URL: https://github.com/apache/hive/pull/5804


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2103251914


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -364,33 +380,15 @@
       </field>
     </class>
 
-    <class name="MColumnDescriptor" identity-type="datastore" table="CDS" detachable="true">
-      <datastore-identity>
-        <column name="CD_ID"/>
-      </datastore-identity>
-      <field name="cols" persistence-modifier="persistent" table="COLUMNS_V2">
-        <collection element-type="MFieldSchema" dependent-element="true" />
-        <join>
-          <primary-key name="SQL110922153006740">
-            <column name="CD_ID"/>
-            <column name="COLUMN_NAME"/>
-          </primary-key>
-          <column name="CD_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="name">
-              <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="type">
-              <column name="TYPE_NAME" length="32672" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="comment">
-              <column name="COMMENT" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-            </field>
-          </embedded>
-        </element>
+    <class name="MColumnDescriptor" identity-type="application" table="CDS" detachable="true">
+      <field name="id" primary-key="true" value-strategy="native">
+        <column name="CD_ID" jdbc-type="BIGINT" />
+      </field>
+      <field name="fields" mapped-by="cd">
+        <order column="INTEGER_IDX"/>
+        <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none"></field>

Review Comment:
   nit: why not use a self-closing tag as in the example?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2077073549


##########
standalone-metastore/metastore-server/src/main/resources/datanucleus-log4j.properties:
##########
@@ -30,5 +30,5 @@ log4j.category.DataNucleus.Transaction=INFO, A1
 log4j.category.DataNucleus.Datastore=DEBUG, A1
 log4j.category.DataNucleus.ValueGeneration=DEBUG, A1
 
-log4j.category.DataNucleus.Enhancer=INFO, A1
+log4j.category.DataNucleus.Enhancer=DEBUG, A1

Review Comment:
   should we change the debug level?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081198193


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {

Review Comment:
   minor: why not use stream API?
   ````
   this.fields = cols.stream().map(schema -> 
       new MColumn(schema.getName(), schema.getType(), schema.getComment())
     .collect(Collectors.toList())
   ````
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085514269


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   i understand that, but why do you need to reconstruct the `getCols() ` representation
   {code}
     private List<MColumn> fields;
     private long id;
   
     private List<MFieldSchema> cols;
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       
       this.fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
               .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
        return cols
     }
   {code}



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   i understand that, but why do you need to reconstruct the `getCols() ` representation
   ````
     private List<MColumn> fields;
     private long id;
   
     private List<MFieldSchema> cols;
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       
       this.fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
               .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
        return cols
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2904034320

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, could it be simplified to below snippet, rest seems redundant
   ````
   <field name="columns" persistence-modifier="none">
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, could it be simplified to below snippet, rest seems redundant
   ````
   <field name="columns" persistence-modifier="none"/>
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, could it be simplified to just, rest seems redundant
   ````
   <field name="columns" persistence-modifier="none">
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102991208


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   All the fields declared in JDO are persistent by default. i.e.., Data Nucleus assumes that there is mapping of this field to a column in back end db (here it assumes that there is 1-1 mapping of columns field to a column in CDS table). It explicitly say that this field is only used in application layer and that there is no such column in the DB, we need to declare it as persistence-modifier="none".
   `@NotPersistant` annotation mentioned in Java is not taking into effect unless we mention it in `.jdo` class. So I left the annotation for future reference to the developers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2087230529


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   @dengzhhu653, but the `getCols()` is executed in the loop in application code leading to unnecessary repetitive fields transform to List<MFieldSchema>. 
   
   example
   ````
   for (MColumnDescriptor cd : cdIdToColumnDescriptor.values()) {
       rowCount += cd.getCols().size();
   }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081175368


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   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;
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085801664


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   Maintaining a single `fields` looks enough, this `public MColumnDescriptor(List<MFieldSchema> cols)` is called only from the HMS side, and the DataNucleus serializes only the `fields`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2874293892

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2087230529


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   @dengzhhu653, but the `getCols()` is executed in the loop in application code leading to unnessesary repetitive fields transform to List<MFieldSchema>
   
   example
   ````
   for (MColumnDescriptor cd : cdIdToColumnDescriptor.values()) {
         rowCount += cd.getCols().size();
       }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2864567431

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085514269


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   i understand that, but why do you need to reconstruct the `getCols() ` representation?
   ````
     private List<MColumn> fields;
     private long id;
   
     private List<MFieldSchema> cols;
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       
       this.fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
               .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
        return cols
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2899822382

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, why do we need this? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2103251914


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -364,33 +380,15 @@
       </field>
     </class>
 
-    <class name="MColumnDescriptor" identity-type="datastore" table="CDS" detachable="true">
-      <datastore-identity>
-        <column name="CD_ID"/>
-      </datastore-identity>
-      <field name="cols" persistence-modifier="persistent" table="COLUMNS_V2">
-        <collection element-type="MFieldSchema" dependent-element="true" />
-        <join>
-          <primary-key name="SQL110922153006740">
-            <column name="CD_ID"/>
-            <column name="COLUMN_NAME"/>
-          </primary-key>
-          <column name="CD_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="name">
-              <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="type">
-              <column name="TYPE_NAME" length="32672" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="comment">
-              <column name="COMMENT" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-            </field>
-          </embedded>
-        </element>
+    <class name="MColumnDescriptor" identity-type="application" table="CDS" detachable="true">
+      <field name="id" primary-key="true" value-strategy="native">
+        <column name="CD_ID" jdbc-type="BIGINT" />
+      </field>
+      <field name="fields" mapped-by="cd">
+        <order column="INTEGER_IDX"/>
+        <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none"></field>

Review Comment:
   nit: why not use a self-closing tag as in the example?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085446288


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {

Review Comment:
   ack



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {

Review Comment:
   ack



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2087230529


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   @dengzhhu653, but the getCols() is executed in the loop in application code leading to unnessesary repetitive fields transform to List<MFieldSchema>



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   @dengzhhu653, but the `getCols()` is executed in the loop in application code leading to unnessesary repetitive fields transform to List<MFieldSchema>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085544329


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   I understand this, but why do we need to reconstruct `getCols()` representations?
   ````
   public class MColumnDescriptor {
   
     private List<MFieldSchema> cols;
     
     private List<MColumn> fields;
     private long id;
   
     public MColumnDescriptor() {}
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
         .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
       if (cols != null) {
         return cols;
       }
       cols = new ArrayList<>();
       if (fields != null) {
         cols = getFields().stream().map(column ->
             new MFieldSchema(column.getName(), column.getType(), column.getComment()))
           .collect(Collectors.toList());
       }
       return cols;
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2088293516


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   My concern here is not about `fields`, but their transformed representation returned by `getCols()`.  Please check https://github.com/apache/hive/pull/5804#discussion_r2087230529 comment



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081175368


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081208071


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2081198193


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {

Review Comment:
   minor: why not use stream API?
   ````
   columns = cols.stream()
     .map(schema -> new MColumn(schema.getName(), schema.getType(), schema.getComment())
     .collect(Collectors.toList())
   ````
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2087230529


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   @dengzhhu653, but the `getCols()` is executed in the loop in application code leading to unnecessary repetitive fields transform to List<MFieldSchema>. 
   
   example
   ````
   for (MColumnDescriptor cd : cdIdToColumnDescriptor.values()) {
       rowCount += cd.getCols().size();
   }
   ````
   also `sd.getCD().getCols() == null` now would always be false



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085544329


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   I understand this, but why do we need to reconstruct `getCols()` representations?
   ````
   public class MColumnDescriptor {
   
     private List<MFieldSchema> cols;
     
     private List<MColumn> fields;
     private long id;
   
     public MColumnDescriptor() {}
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
         .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
       if (cols == null) {
         cols = new ArrayList<>();
         
         if (fields != null) {
           cols = getFields().stream().map(column ->
               new MFieldSchema(column.getName(), column.getType(), column.getComment()))
             .collect(Collectors.toList());
         }
       }
       return cols;
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085544329


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   I understand this, but why do we need to always reconstruct `getCols()` representations? it's frequently called in a loop
   ````
   public class MColumnDescriptor {
   
     private List<MFieldSchema> cols;
     
     private List<MColumn> fields;
     private long id;
   
     public MColumnDescriptor() {}
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
         .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
       if (cols != null) {
         return cols;
       }
       cols = new ArrayList<>();
       if (fields != null) {
         cols = getFields().stream().map(column ->
             new MFieldSchema(column.getName(), column.getType(), column.getComment()))
           .collect(Collectors.toList());
       }
       return cols;
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2088293516


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   My concern here is not about `fields`, but their transformed representation returned by `getCols()`.  Please check https://github.com/apache/hive/pull/5804#discussion_r2087230529
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "Aggarwal-Raghav (via GitHub)" <gi...@apache.org>.
Aggarwal-Raghav commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2103023990


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @deniskuzZ  @okumin nit: better to check the doc https://www.datanucleus.org/products/accessplatform_6_0/ i.e 6_0 instead of 4_1 which is for datanucleus 4.x. Hoping the most of the things are same in docs, haven't verified myself :-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102998900


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   weird, see https://www.datanucleus.org/products/accessplatform_4_1/jdo/fields_properties.html
   ````
   If you have a field/property that you don’t want to persist, just mark it’s persistence-modifier as none
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, could this be simplified to just
   ````
   <field name="columns" persistence-modifier="none">
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2103145947


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   same thing
   https://www.datanucleus.org/products/accessplatform_6_0/jdo/mapping.html
   
   > Making a field/property non-persistent
   
   If you have a field/property that you don’t want to persist, just mark it’s persistence-modifier as none, like this
   
   ````
   <class name="mydomain.MyClass">
       <field name="unimportantField" persistence-modifier="none"/>
   </class>
   ````



##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   same thing: https://www.datanucleus.org/products/accessplatform_6_0/jdo/mapping.html
   
   > Making a field/property non-persistent
   
   If you have a field/property that you don’t want to persist, just mark it’s persistence-modifier as none, like this
   
   ````
   <class name="mydomain.MyClass">
       <field name="unimportantField" persistence-modifier="none"/>
   </class>
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2864960139

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2077301435


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,37 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
+  }
+
+  public void setColumns(List<MColumn> columns) {

Review Comment:
   do we need both setter and setter constructor?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2077073549


##########
standalone-metastore/metastore-server/src/main/resources/datanucleus-log4j.properties:
##########
@@ -30,5 +30,5 @@ log4j.category.DataNucleus.Transaction=INFO, A1
 log4j.category.DataNucleus.Datastore=DEBUG, A1
 log4j.category.DataNucleus.ValueGeneration=DEBUG, A1
 
-log4j.category.DataNucleus.Enhancer=INFO, A1
+log4j.category.DataNucleus.Enhancer=DEBUG, A1

Review Comment:
   should we change the log level?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2856994836

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085544329


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   I understand this, but why do we need to reconstruct the diff representations?
   ````
   public class MColumnDescriptor {
   
     private List<MFieldSchema> cols;
     
     private List<MColumn> fields;
     private long id;
   
     public MColumnDescriptor() {}
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
         .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
       if (cols != null) {
         return cols;
       }
       cols = new ArrayList<>();
       if (fields != null) {
         cols = getFields().stream().map(column ->
             new MFieldSchema(column.getName(), column.getType(), column.getComment()))
           .collect(Collectors.toList());
       }
       return cols;
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085300600


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   JDK17 doesn't understand MfieldSchema because of the CLOB column in the join statement. So now need two representations 1) MfieldSchema in the application layer 2) Mcolumn in the JDO layer for conversion to/from the database.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2085544329


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,33 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
   }
 
   public List<MFieldSchema> getCols() {
-    return cols;
+    List<MFieldSchema> schemas = new ArrayList<>();
+    if (getColumns() != null) {

Review Comment:
   I understand this, but why do we need to reconstruct `getCols()` representations?
   ````
   public class MColumnDescriptor {
   
     private List<MFieldSchema> cols;
     
     private List<MColumn> fields;
     private long id;
   
     public MColumnDescriptor() {}
   
     public MColumnDescriptor(List<MFieldSchema> cols) {
       this.cols = cols;
       fields = cols.stream().map(schema ->
           new MColumn(schema.getName(), schema.getType(), schema.getComment()))
         .collect(Collectors.toList());
     }
   
     public List<MColumn> getFields() {
       return fields;
     }
   
     public List<MFieldSchema> getCols() {
       if (cols == null) {
         cols = new ArrayList<>();
         if (fields != null) {
           cols = getFields().stream().map(column ->
               new MFieldSchema(column.getName(), column.getType(), column.getComment()))
             .collect(Collectors.toList());
         }
       }
       return cols;
     }
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2080613991


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/model/MColumnDescriptor.java:
##########
@@ -29,23 +30,37 @@
  * A wrapper around a list of columns.
  */
 public class MColumnDescriptor {
-  private List<MFieldSchema> cols;
+  private List<MColumn> columns;
+  private long id;
 
   public MColumnDescriptor() {}
 
-  /**
-   *
-   * @param cols
-   */
   public MColumnDescriptor(List<MFieldSchema> cols) {
-    this.cols = cols;
+    columns = new ArrayList<>(cols.size());
+    for (MFieldSchema schema : cols) {
+      columns.add(new MColumn(schema.getName(), schema.getType(), schema.getComment()));
+    }
+  }
+
+  public List<MColumn> getColumns() {
+    return columns;
+  }
+
+  public void setColumns(List<MColumn> columns) {

Review Comment:
   We don't need this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2080613634


##########
standalone-metastore/metastore-server/src/main/resources/datanucleus-log4j.properties:
##########
@@ -30,5 +30,5 @@ log4j.category.DataNucleus.Transaction=INFO, A1
 log4j.category.DataNucleus.Datastore=DEBUG, A1
 log4j.category.DataNucleus.ValueGeneration=DEBUG, A1
 
-log4j.category.DataNucleus.Enhancer=INFO, A1
+log4j.category.DataNucleus.Enhancer=DEBUG, A1

Review Comment:
   Not required. Changing it back.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5804:
URL: https://github.com/apache/hive/pull/5804#issuecomment-2902966869

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5804&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5804&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5804&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5804)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102586657


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   @saihemanth-cloudera, why do we need this?  @NotPersistent is not enough? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2102995116


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   without `default-fetch-group="false"` DataNucleus tries to read this field and it fails, so I had to include it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28909: Modify McolumnDescriptor definition in package.jdo to sup… [hive]

Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5804:
URL: https://github.com/apache/hive/pull/5804#discussion_r2103233707


##########
standalone-metastore/metastore-server/src/main/resources/package.jdo:
##########
@@ -384,10 +384,13 @@
       <field name="id" primary-key="true" value-strategy="native">
         <column name="CD_ID" jdbc-type="BIGINT" />
       </field>
-      <field name="columns" mapped-by="cd">
+      <field name="fields" mapped-by="cd">
         <order column="INTEGER_IDX"/>
         <collection element-type="MColumn" dependent-element="true" />
       </field>
+      <field name="columns" persistence-modifier="none">

Review Comment:
   tested and verified. It works.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org