diff --git a/hugegraph-loader/assembly/descriptor/assembly.xml b/hugegraph-loader/assembly/descriptor/assembly.xml index 62fe67935..efac0b5c8 100644 --- a/hugegraph-loader/assembly/descriptor/assembly.xml +++ b/hugegraph-loader/assembly/descriptor/assembly.xml @@ -48,6 +48,9 @@ ${project.build.directory} lib + + hugegraph-loader-1.0.0.jar + *.jar diff --git a/hugegraph-loader/assembly/static/bin/hugegraph-spark-loader.sh b/hugegraph-loader/assembly/static/bin/hugegraph-spark-loader.sh index c6bb08b84..ee93c63f0 100755 --- a/hugegraph-loader/assembly/static/bin/hugegraph-spark-loader.sh +++ b/hugegraph-loader/assembly/static/bin/hugegraph-spark-loader.sh @@ -25,7 +25,7 @@ get_params "$@" echo "engine_params: $ENGINE_PARAMS" echo "hugegraph_params: $HUGEGRAPH_PARAMS" -ASSEMBLY_JAR_NAME=$(find "${LIB_DIR}" -name 'hugegraph-loader*.jar') +ASSEMBLY_JAR_NAME=$(find "${LIB_DIR}" -name 'apache-hugegraph-loader*.jar') DEFAULT_APP_NAME="hugegraph-spark-loader" APP_NAME=${APP_NAME:-$DEFAULT_APP_NAME} diff --git a/hugegraph-loader/pom.xml b/hugegraph-loader/pom.xml index 6ff5e69ce..c62b8b28d 100644 --- a/hugegraph-loader/pom.xml +++ b/hugegraph-loader/pom.xml @@ -90,8 +90,17 @@ jersey-server org.glassfish.jersey.core + + gson + com.google.code.gson + + + gson + com.google.code.gson + ${gson.version} + org.apache.spark spark-sql_${scala.version} @@ -614,6 +623,57 @@ org.apache.maven.plugins maven-compiler-plugin + + org.apache.maven.plugins + maven-shade-plugin + 3.4.1 + + + package + + shade + + + false + ${final.name}-shaded + + + org.glassfish.jersey + shaded.org.glassfish.jersey + + + jakarta.ws.rs + shaded.jakarta.ws.rs + + + com.google.common.base + shaded.com.google.common.base + + + org.glassfish.hk2 + shaded.org.glassfish.hk2 + + + org.jvnet.hk2 + shaded.org.jvnet.hk2 + + + + + + + + + *:* + + module-info.class + + + + + + + org.apache.maven.plugins maven-assembly-plugin diff --git a/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/spark/HugeGraphSparkLoader.java b/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/spark/HugeGraphSparkLoader.java index 228f2db03..5ee060724 100644 --- a/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/spark/HugeGraphSparkLoader.java +++ b/hugegraph-loader/src/main/java/org/apache/hugegraph/loader/spark/HugeGraphSparkLoader.java @@ -60,6 +60,7 @@ import org.slf4j.Logger; import java.io.Serializable; +import java.util.Optional; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -292,9 +293,13 @@ private void parse(Row row, Map.Entry> builde case FILE: case HDFS: FileSource fileSource = struct.input().asFileSource(); - String delimiter = fileSource.delimiter(); - elements = builder.build(fileSource.header(), - row.mkString(delimiter).split(delimiter)); + String delimiter = fileSource.delimiter() ; + if (Optional.ofNullable(delimiter).isPresent()) { + elements = builder.build(fileSource.header(), + row.mkString(delimiter).split(delimiter)); + }else { + elements = builder.build(row); + } break; case JDBC: Object[] structFields = JavaConverters.asJavaCollection(row.schema().toList()) diff --git a/hugegraph-loader/src/main/resources/META-INF/services/shaded.jakarta.ws.rs.client.ClientBuilder b/hugegraph-loader/src/main/resources/META-INF/services/shaded.jakarta.ws.rs.client.ClientBuilder new file mode 100644 index 000000000..7205ceb4f --- /dev/null +++ b/hugegraph-loader/src/main/resources/META-INF/services/shaded.jakarta.ws.rs.client.ClientBuilder @@ -0,0 +1,16 @@ +# +# 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. +shaded.org.glassfish.jersey.client.JerseyClientBuilder diff --git a/hugegraph-loader/src/main/resources/META-INF/services/shaded.org.glassfish.hk2.extension.ServiceLocatorGenerator b/hugegraph-loader/src/main/resources/META-INF/services/shaded.org.glassfish.hk2.extension.ServiceLocatorGenerator new file mode 100644 index 000000000..bad820aa7 --- /dev/null +++ b/hugegraph-loader/src/main/resources/META-INF/services/shaded.org.glassfish.hk2.extension.ServiceLocatorGenerator @@ -0,0 +1,16 @@ +# +# 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. +org.jvnet.hk2.external.generator.ServiceLocatorGeneratorImpl