This is an automated email from the ASF dual-hosted git repository.

gabor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-mr.git


The following commit(s) were added to refs/heads/master by this push:
     new 3be6273  PARQUET-1970: Make minor releases source compatible (#861)
3be6273 is described below

commit 3be6273156247a52e295e002bc38217373b68b22
Author: Gabor Szadovszky <[email protected]>
AuthorDate: Wed Feb 10 10:59:53 2021 +0100

    PARQUET-1970: Make minor releases source compatible (#861)
---
 .../org/apache/parquet/internal/column/columnindex/OffsetIndex.java | 6 ++++--
 parquet-common/src/main/java/org/apache/parquet/io/OutputFile.java  | 4 +++-
 .../parquet/crypto/keytools/PropertiesDrivenCryptoFactory.java      | 3 +++
 .../src/main/java/org/apache/parquet/hadoop/ParquetWriter.java      | 5 +++--
 pom.xml                                                             | 2 +-
 5 files changed, 14 insertions(+), 6 deletions(-)

diff --git 
a/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/OffsetIndex.java
 
b/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/OffsetIndex.java
index 02d58af..6c16294 100644
--- 
a/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/OffsetIndex.java
+++ 
b/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/OffsetIndex.java
@@ -49,13 +49,15 @@ public interface OffsetIndex {
    * @return the index of the first row in the page
    */
   public long getFirstRowIndex(int pageIndex);
-  
+
   /**
    * @param pageIndex
    *         the index of the page
    * @return the original ordinal of the page in the column chunk
    */
-  public int getPageOrdinal(int pageIndex);
+  public default int getPageOrdinal(int pageIndex) {
+    return pageIndex;
+  }
 
   /**
    * @param pageIndex
diff --git a/parquet-common/src/main/java/org/apache/parquet/io/OutputFile.java 
b/parquet-common/src/main/java/org/apache/parquet/io/OutputFile.java
index e1558ce..7733175 100644
--- a/parquet-common/src/main/java/org/apache/parquet/io/OutputFile.java
+++ b/parquet-common/src/main/java/org/apache/parquet/io/OutputFile.java
@@ -31,5 +31,7 @@ public interface OutputFile {
 
   long defaultBlockSize();
 
-  String getPath();
+  default String getPath() {
+    return null;
+  }
 }
diff --git 
a/parquet-hadoop/src/main/java/org/apache/parquet/crypto/keytools/PropertiesDrivenCryptoFactory.java
 
b/parquet-hadoop/src/main/java/org/apache/parquet/crypto/keytools/PropertiesDrivenCryptoFactory.java
index 8fdeca2..f35d9ec 100644
--- 
a/parquet-hadoop/src/main/java/org/apache/parquet/crypto/keytools/PropertiesDrivenCryptoFactory.java
+++ 
b/parquet-hadoop/src/main/java/org/apache/parquet/crypto/keytools/PropertiesDrivenCryptoFactory.java
@@ -92,6 +92,9 @@ public class PropertiesDrivenCryptoFactory implements 
EncryptionPropertiesFactor
     boolean keyMaterialInternalStorage = 
fileHadoopConfig.getBoolean(KeyToolkit.KEY_MATERIAL_INTERNAL_PROPERTY_NAME,
         KeyToolkit.KEY_MATERIAL_INTERNAL_DEFAULT);
     if (!keyMaterialInternalStorage) {
+      if (tempFilePath == null) {
+        throw new ParquetCryptoRuntimeException("Output file path cannot be 
null");
+      }
       try {
         keyMaterialStore = new 
HadoopFSKeyMaterialStore(tempFilePath.getFileSystem(fileHadoopConfig));
         keyMaterialStore.initialize(tempFilePath, fileHadoopConfig, false);
diff --git 
a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java 
b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java
index c571afd..550cd33 100644
--- a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java
+++ b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java
@@ -194,7 +194,7 @@ public class ParquetWriter<T> implements Closeable {
         compressionCodecName, blockSize, pageSize, dictionaryPageSize,
         enableDictionary, validating, writerVersion, conf);
   }
-  
+
   /**
    * Create a new ParquetWriter.
    *
@@ -281,7 +281,8 @@ public class ParquetWriter<T> implements Closeable {
 
     // encryptionProperties could be built from the implementation of 
EncryptionPropertiesFactory when it is attached.
     if (encryptionProperties == null) {
-      encryptionProperties = 
ParquetOutputFormat.createEncryptionProperties(conf, new Path(file.getPath()), 
writeContext);
+      encryptionProperties = 
ParquetOutputFormat.createEncryptionProperties(conf,
+          file == null ? null : new Path(file.getPath()), writeContext);
     }
 
     ParquetFileWriter fileWriter = new ParquetFileWriter(
diff --git a/pom.xml b/pom.xml
index 685e194..c076c76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -503,7 +503,7 @@
         <configuration>
           <parameter>
             <oldVersionPattern>${previous.version}</oldVersionPattern>
-            
<breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
+            
<breakBuildOnSourceIncompatibleModifications>true</breakBuildOnSourceIncompatibleModifications>
             <onlyModified>true</onlyModified>
             <overrideCompatibilityChangeParameters>
               <!-- Adding a new method with default implementation to an 
interface should be a compatible change.

Reply via email to