You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "attilakreiner (via GitHub)" <gi...@apache.org> on 2024/07/10 09:00:36 UTC

[PR] Add checkstyle rule for uppercase constant fields [iceberg]

attilakreiner opened a new pull request, #10673:
URL: https://github.com/apache/iceberg/pull/10673

   (no 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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672584641


##########
mr/src/main/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSupport.java:
##########
@@ -34,11 +34,11 @@ public enum Support {
       this.lowerCaseName = name().toLowerCase(Locale.ROOT);
     }
 
-    public static final Map<String, Support> nameToSupportMap = Maps.newHashMap();
+    public static final Map<String, Support> NAME_TO_SUPPORT_MAP = Maps.newHashMap();

Review Comment:
   Thanks for pointing it out. I reverted this change. I think it's fair to think about this one an exceptional case, so I added `@SuppressWarnings("checkstyle:ConstantName")` to overcome the issue. Pls LMK if this fix is OK.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673890383


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   I think for this PR we should just stick with the [default regex pattern of checkstyle](https://checkstyle.sourceforge.io/checks/naming/constantname.html), which I believe is what you had initially. Improving the regex can be done in a separate PR. 



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672596840


##########
mr/src/main/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSupport.java:
##########
@@ -34,11 +34,11 @@ public enum Support {
       this.lowerCaseName = name().toLowerCase(Locale.ROOT);
     }
 
-    public static final Map<String, Support> nameToSupportMap = Maps.newHashMap();
+    public static final Map<String, Support> NAME_TO_SUPPORT_MAP = Maps.newHashMap();

Review Comment:
   just adding some additional context that Iceberg only provides API/ABI stability for certain modules (`iceberg-mr` module isn't included) which is enforced by `revapi`, but great if we can avoid breaking the API/ABI for modules where we don't enforce 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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672448959


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   I updated the regexp from
   `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`
   to
   `^[A-Z][A-Z0-9]+(_[A-Z0-9]+)*$`
   Pls mind the `*` vs `+` char at pos 15. Pls clarify whether or not this is what you were pointing out.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672584641


##########
mr/src/main/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSupport.java:
##########
@@ -34,11 +34,11 @@ public enum Support {
       this.lowerCaseName = name().toLowerCase(Locale.ROOT);
     }
 
-    public static final Map<String, Support> nameToSupportMap = Maps.newHashMap();
+    public static final Map<String, Support> NAME_TO_SUPPORT_MAP = Maps.newHashMap();

Review Comment:
   Thanks for pointing it out. I reverted this change. I think it's fair to think about this one as an exceptional case, so I added `@SuppressWarnings("checkstyle:ConstantName")` to overcome the issue. Pls LMK if this fix is OK.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673751208


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+            <message key="name.invalidPattern" value="Constant name ''{0}'' must match pattern ''{1}''."/>

Review Comment:
   Both messages are clear and actionable. My preference would be not to add configuration that is not needed.
   I noticed we do set this for other checks, and I believe we can remove those other configurations too, in places where they do not add much value.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673753534


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   to leverage possessive quantifiers replace 
   ```
   ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$
   ```
   
   with 
   ```
   ^[A-Z][A-Z0-9]*+(_[A-Z0-9]++)*+$
   ```



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673906437


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   @nastra, yep, same thought here, hence the spin-off draft PR.
   
   In this PR the definition I used is this (this is the current state right now):
   `<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   the default you linked is this:
   `<property name="format" value="^log(ger)?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   So the only difference is I removed the first part that allows for the lowercase `log(ger)` as this codebase doesn't use it, so it was redundant.
   
   Also we have the custom message in place to be consistent with the rest of the definitions for now.
   
   Pls LMK if this is all good as it is right now or we need some changes here.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

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


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672616640


##########
mr/src/main/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSupport.java:
##########
@@ -34,11 +34,11 @@ public enum Support {
       this.lowerCaseName = name().toLowerCase(Locale.ROOT);
     }
 
-    public static final Map<String, Support> nameToSupportMap = Maps.newHashMap();
+    public static final Map<String, Support> NAME_TO_SUPPORT_MAP = Maps.newHashMap();

Review Comment:
   WFM



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673884503


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   Thanks, I see. I experimented a bit with the possessive quantifiers in the regexes as well as removing some custom messages that seem redundant. 
   
   I created a draft PR with these changes: #10681. Even though it seems like just a few lines of changes, it has an impact for the whole codebase and I don't want to hold up this one. (I'd prefer to keep the scope of this PR tight, really just renaming the constants to uppercase and enforcing that rule.)



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672463692


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   **Update:** I reverted this change as it breaks for `Z_COLUMN`, `Z_SCHEMA` and `Z_SORT_ORDER`.
   
   Pls point out if you suggest a different regexp here. 🤔



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673906437


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   @nastra, yep, same thought here, hence the spin-off draft PR.
   
   In this PR the definition I used is this (this is the current state right now):
   `<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   the default you linked is this:
   `<property name="format" ="^log(ger)?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   So the only difference is I removed the first part that allows for the lowercase `log(ger)` as this codebase doesn't use it, so it was redundant.
   
   Also we have the custom message in place to be consistent with the rest of the definitions for now.
   
   Pls LMK if this is all good as it is right now or we need some changes here.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#issuecomment-2220152602

   @attilakreiner thanks for doing this and generally this looks good. 
   
   Could you please extract the Spark + Flink changes into a separate PR (where checkstyle doesn't enforce this naming yet)? I'll review the Spark + Flink changes first (as those typically get quite large) and once those changes are in, we can continue with this PR (containing the changes for all other modules + enforcing the naming).


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673906437


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   @nastra, yep, same thought here, hence the spin-off draft PR.
   
   In this PR the definition I used is this (this is the current state right now):
   `<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   the default you linked is this:
   `<property name="format" ="^log(ger)?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   So the only difference is I removed the first part that allows for the lowercase `log(ger)` as this codebase doesn't use it, so it was redundant.
   
   Also we have the custom message in place to be consistent with the rest of the definitions for now.
   
   Pls LMK if this is all good as it right now or we need some changes here.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673906437


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   @nastra, yep, same thought here, hence the spin-off draft PR.
   
   In this PR the definition I used is this (this is the current state right now):
   `<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   the default you linked is this:
   `<property name="format" ="^log(ger)?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>`
   
   So the only difference is I removed the first part the allows for the lowercase `log(ger)` as this codebase doesn't use it, so it was redundant.
   
   Also we have the custom message in place to be consistent with the rest of the definitions for now.
   
   Pls LMK if this is all good as it right now or we need some changes here.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672212565


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>

Review Comment:
   you can use possessive quantifiers. That way the matching might be simpler.
   I didn't benchmark it, but checksyle can take considerable time overall, and small things like this add up.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#issuecomment-2220750660

   Merged in the `main` branch.


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673885080


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+            <message key="name.invalidPattern" value="Constant name ''{0}'' must match pattern ''{1}''."/>

Review Comment:
   Got it. Pls see my previous 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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#issuecomment-2220364967

   @nastra, got it done.
   
   - I reverted the flink+spark changes in this PR.
   - I created this PR https://github.com/apache/iceberg/pull/10675 for the flink+spark changes.


-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672537490


##########
mr/src/main/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSupport.java:
##########
@@ -34,11 +34,11 @@ public enum Support {
       this.lowerCaseName = name().toLowerCase(Locale.ROOT);
     }
 
-    public static final Map<String, Support> nameToSupportMap = Maps.newHashMap();
+    public static final Map<String, Support> NAME_TO_SUPPORT_MAP = Maps.newHashMap();

Review Comment:
   This changes a publicly accessible field - a breaking ABI change.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672588007


##########
mr/src/main/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedSupport.java:
##########
@@ -34,11 +34,11 @@ public enum Support {
       this.lowerCaseName = name().toLowerCase(Locale.ROOT);
     }
 
-    public static final Map<String, Support> nameToSupportMap = Maps.newHashMap();
+    public static final Map<String, Support> NAME_TO_SUPPORT_MAP = Maps.newHashMap();

Review Comment:
   I double checked the PR for similar cases and I did not find any more `public static` fields that were affected.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673885080


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+            <message key="name.invalidPattern" value="Constant name ''{0}'' must match pattern ''{1}''."/>

Review Comment:
   Got it. Pls see me previous 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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1673885080


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+            <message key="name.invalidPattern" value="Constant name ''{0}'' must match pattern ''{1}''."/>

Review Comment:
   Got it. Pls see my previous comment about https://github.com/apache/iceberg/pull/10681.



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "findepi (via GitHub)" <gi...@apache.org>.
findepi commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672214057


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+            <message key="name.invalidPattern" value="Constant name ''{0}'' must match pattern ''{1}''."/>

Review Comment:
   Is this property needed? What error message does checkstyle produce when we omit 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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Add checkstyle rule for uppercase constant fields [iceberg]

Posted by "attilakreiner (via GitHub)" <gi...@apache.org>.
attilakreiner commented on code in PR #10673:
URL: https://github.com/apache/iceberg/pull/10673#discussion_r1672440967


##########
.baseline/checkstyle/checkstyle.xml:
##########
@@ -284,6 +284,10 @@
             <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
             <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
         </module>
+        <module name="ConstantName">
+            <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+            <message key="name.invalidPattern" value="Constant name ''{0}'' must match pattern ''{1}''."/>

Review Comment:
   The message without this property is:
   `Name 'factory' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'. [ConstantName]`
   with this property it's:
   `Constant name 'factory' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'. [ConstantName]`
   
   My preference is to keep it as both the definition and the output is more consistent with the existing rules.
   



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org