Copilot commented on code in PR #2659:
URL: https://github.com/apache/phoenix/pull/2659#discussion_r4484956668


##########
phoenix-core/src/test/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtilTest.java:
##########
@@ -44,6 +44,7 @@ public void testAddPhoenixDependencyJars() throws Exception {
     assertTrue("Should contain jackson-databind", 
tmpjars.contains("jackson-databind"));
     assertTrue("Should contain jackson-annotations", 
tmpjars.contains("jackson-annotations"));
     assertTrue("Should contain commons-csv", tmpjars.contains("commons-csv"));
+    assertTrue("Should contain commons-io", tmpjars.contains("commons-io"));

Review Comment:
   This assertion can produce a false positive if an incompatible `commons-io` 
(for example 2.16 from Hadoop) is present in `tmpjars`, since it only checks 
for the substring `commons-io`. Consider tightening the test to validate the 
actual jar/version being shipped (e.g., parse the `tmpjars` entries and assert 
a minimum version) or validate that the shipped jar actually contains 
`org/apache/commons/io/input/UnsynchronizedBufferedReader.class`.



##########
phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java:
##########
@@ -99,6 +100,9 @@ public static void addPhoenixDependencyJars(Configuration 
conf) throws IOExcepti
       JsonAutoDetect.class,
       // commons-csv
       CSVFormat.class,
+      // commons-io. commons-csv needs this class, which older releases such 
as the one in Hadoop
+      // of various version up through 3.4 do not have available on the 
classpath.

Review Comment:
   Correct grammar in the comment: change 'various version' to 'various 
versions'.



##########
phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java:
##########
@@ -27,6 +27,7 @@
 import java.sql.SQLException;
 import org.antlr.runtime.CharStream;
 import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.io.input.UnsynchronizedBufferedReader;

Review Comment:
   Referencing `UnsynchronizedBufferedReader` introduces a hard requirement 
that a compatible `commons-io` (2.17+) is on the submitting client’s classpath 
when `addPhoenixDependencyJars` runs. To prevent runtime/classpath conflicts 
(especially with Hadoop’s older `commons-io`), ensure the build/dependency 
management pins `commons-io` to 2.17+ for this module and avoids being 
overridden by transitive Hadoop dependencies (for example via explicit 
dependency + exclusions where Hadoop brings in `commons-io`).



##########
phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMapReduceUtil.java:
##########
@@ -99,6 +100,9 @@ public static void addPhoenixDependencyJars(Configuration 
conf) throws IOExcepti
       JsonAutoDetect.class,
       // commons-csv
       CSVFormat.class,
+      // commons-io. commons-csv needs this class, which older releases such 
as the one in Hadoop
+      // of various version up through 3.4 do not have available on the 
classpath.
+      UnsynchronizedBufferedReader.class,

Review Comment:
   Referencing `UnsynchronizedBufferedReader` introduces a hard requirement 
that a compatible `commons-io` (2.17+) is on the submitting client’s classpath 
when `addPhoenixDependencyJars` runs. To prevent runtime/classpath conflicts 
(especially with Hadoop’s older `commons-io`), ensure the build/dependency 
management pins `commons-io` to 2.17+ for this module and avoids being 
overridden by transitive Hadoop dependencies (for example via explicit 
dependency + exclusions where Hadoop brings in `commons-io`).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to