Skip to content

Commit

Permalink
HIVE-28224: Upgrade Orc version in Hive to 1.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Fingerman committed Apr 26, 2024
1 parent e980c7a commit e438f4d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@
<mysql.version>8.0.31</mysql.version>
<postgres.version>42.7.3</postgres.version>
<oracle.version>21.3.0.0</oracle.version>
<opencsv.version>2.3</opencsv.version>
<orc.version>1.8.5</orc.version>
<opencsv.version>5.9</opencsv.version>
<orc.version>1.9.3</orc.version>
<mockito-core.version>3.4.4</mockito-core.version>
<mockito-inline.version>4.11.0</mockito-inline.version>
<mina.version>2.0.0-M5</mina.version>
Expand Down
16 changes: 11 additions & 5 deletions ql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,6 @@
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</dependency>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>${opencsv.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-standalone-metastore-server</artifactId>
Expand Down Expand Up @@ -759,6 +754,17 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>${opencsv.version}</version>
<exclusions>
<exclusion>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tez</groupId>
<artifactId>tez-dag</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion serde/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.opencsv</groupId>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>${opencsv.version}</version>
</dependency>
Expand Down
14 changes: 9 additions & 5 deletions serde/src/java/org/apache/hadoop/hive/serde2/OpenCSVSerde.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
import java.util.Objects;
import java.util.Properties;

import au.com.bytecode.opencsv.CSVReader;
import au.com.bytecode.opencsv.CSVWriter;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import com.opencsv.CSVWriter;

/**
* OpenCSVSerde use opencsv to deserialize CSV format.
Expand Down Expand Up @@ -179,15 +181,17 @@ private CSVReader newReader(final Reader reader, char separator, char quote, cha
// CSVReader will throw an exception if any of separator, quote, or escape is the same, but
// the CSV format specifies that the escape character and quote char are the same... very weird
if (CSVWriter.DEFAULT_ESCAPE_CHARACTER == escape) {
return new CSVReader(reader, separator, quote);
return new CSVReaderBuilder(reader).withCSVParser(
new CSVParserBuilder().withSeparator(separator).withQuoteChar(quote).build()).build();
} else {
return new CSVReader(reader, separator, quote, escape);
return new CSVReaderBuilder(reader).withCSVParser(
new CSVParserBuilder().withSeparator(separator).withQuoteChar(quote).withEscapeChar(escape).build()).build();
}
}

private CSVWriter newWriter(final Writer writer, char separator, char quote, char escape) {
if (CSVWriter.DEFAULT_ESCAPE_CHARACTER == escape) {
return new CSVWriter(writer, separator, quote, "");
return new CSVWriter(writer, separator, quote, '"', "");
} else {
return new CSVWriter(writer, separator, quote, escape, "");
}
Expand Down
2 changes: 1 addition & 1 deletion standalone-metastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<libthrift.version>0.16.0</libthrift.version>
<log4j2.version>2.18.0</log4j2.version>
<mockito-core.version>3.4.4</mockito-core.version>
<orc.version>1.8.5</orc.version>
<orc.version>1.9.3</orc.version>
<protobuf.version>3.24.4</protobuf.version>
<io.grpc.version>1.51.0</io.grpc.version>
<sqlline.version>1.9.0</sqlline.version>
Expand Down

0 comments on commit e438f4d

Please sign in to comment.