Skip to content

Commit

Permalink
apacheGH-38997: [Java] Modularize format and vector (apache#38995)
Browse files Browse the repository at this point in the history
### Rationale for this change
This PR depends on apache#39011 .

Make arrow-vector and arrow-format JPMS modules for improved
compatibility with newer JDKs and tools that require modules.

### What changes are included in this PR?
* add module-info.java files for vector and format.

### Are these changes tested?
Yes, these modules are run as JPMS modules in JDK9+ unit tests.

### Are there any user-facing changes?
Yes, some test classes have moved and users can now run these as JPMS
modules.

* Closes: apache#38997
  • Loading branch information
jduo authored and thisisnic committed Mar 8, 2024
1 parent cd0a896 commit 52b6ddf
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.arrow.dataset.file.DatasetFileWriter;
import org.apache.arrow.dataset.file.FileFormat;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.util.ArrowTestDataUtil;
import org.apache.arrow.vector.BigIntVector;
import org.apache.arrow.vector.BitVector;
import org.apache.arrow.vector.DateMilliVector;
Expand Down Expand Up @@ -76,6 +75,7 @@
import org.apache.arrow.vector.types.pojo.Field;
import org.apache.arrow.vector.types.pojo.FieldType;
import org.apache.arrow.vector.types.pojo.Schema;
import org.apache.arrow.vector.util.ArrowTestDataUtil;
import org.apache.arrow.vector.util.ByteArrayReadableSeekableByteChannel;
import org.apache.arrow.vector.util.Text;
import org.junit.ClassRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.List;
import java.util.Random;

import org.apache.arrow.util.ArrowTestDataUtil;
import org.apache.arrow.vector.util.ArrowTestDataUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.function.Executable;

Expand Down
21 changes: 21 additions & 0 deletions java/format/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module org.apache.arrow.format {
exports org.apache.arrow.flatbuf;
requires transitive flatbuffers.java;
}
4 changes: 4 additions & 0 deletions java/vector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-core</artifactId>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand Down
3 changes: 0 additions & 3 deletions java/vector/src/main/codegen/includes/vv_imports.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.ByteBuffer;

import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.Duration;
Expand Down
50 changes: 50 additions & 0 deletions java/vector/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module org.apache.arrow.vector {
exports org.apache.arrow.vector;
exports org.apache.arrow.vector.compare;
exports org.apache.arrow.vector.compare.util;
exports org.apache.arrow.vector.complex;
exports org.apache.arrow.vector.complex.impl;
exports org.apache.arrow.vector.complex.reader;
exports org.apache.arrow.vector.complex.writer;
exports org.apache.arrow.vector.compression;
exports org.apache.arrow.vector.dictionary;
exports org.apache.arrow.vector.holders;
exports org.apache.arrow.vector.ipc;
exports org.apache.arrow.vector.ipc.message;
exports org.apache.arrow.vector.table;
exports org.apache.arrow.vector.types;
exports org.apache.arrow.vector.types.pojo;
exports org.apache.arrow.vector.util;
exports org.apache.arrow.vector.validate;

opens org.apache.arrow.vector.types.pojo to com.fasterxml.jackson.databind;

requires com.fasterxml.jackson.annotation;
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.datatype.jsr310;
requires flatbuffers.java;
requires jdk.unsupported;
requires org.apache.arrow.format;
requires org.apache.arrow.memory.core;
requires org.apache.commons.codec;
requires org.eclipse.collections.impl;
requires org.slf4j;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.arrow.util;
package org.apache.arrow.vector.util;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.arrow.util;
package org.apache.arrow.vector.util;

import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
Expand Down

0 comments on commit 52b6ddf

Please sign in to comment.