Skip to content

Commit b2deb97

Browse files
committed
Revert "Merge pull request #166 from marklogic/feature/12332-read-triples"
This reverts commit c7f0fa8.
1 parent c7f0fa8 commit b2deb97

File tree

12 files changed

+9
-307
lines changed

12 files changed

+9
-307
lines changed

build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ group 'com.marklogic'
1313
version '2.2-SNAPSHOT'
1414

1515
java {
16-
// To support reading RDF files, Apache Jena is used - but that requires Java 11. If we want to do a 2.2.0 release
17-
// without requiring Java 11, we'll remove the support for reading RDF files along with the Jena dependency.
18-
sourceCompatibility = 11
19-
targetCompatibility = 11
16+
sourceCompatibility = 1.8
17+
targetCompatibility = 1.8
2018
}
2119

2220
repositories {
@@ -42,8 +40,6 @@ dependencies {
4240
exclude module: "scala-library"
4341
}
4442

45-
implementation "org.apache.jena:jena-arq:4.10.0"
46-
4743
testImplementation 'org.apache.spark:spark-sql_2.12:' + sparkVersion
4844

4945
// The exclusions in these two modules ensure that we use the Jackson libraries from spark-sql when running the tests.
@@ -60,7 +56,7 @@ dependencies {
6056
exclude module: 'jackson-dataformat-csv'
6157
}
6258

63-
testImplementation "ch.qos.logback:logback-classic:1.3.14"
59+
testImplementation "ch.qos.logback:logback-classic:1.3.5"
6460
testImplementation "org.slf4j:jcl-over-slf4j:1.7.36"
6561
testImplementation "org.skyscreamer:jsonassert:1.5.1"
6662
}

src/main/java/com/marklogic/spark/DefaultSource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.marklogic.spark.reader.document.DocumentRowSchema;
2222
import com.marklogic.spark.reader.document.DocumentTable;
2323
import com.marklogic.spark.reader.file.FileRowSchema;
24-
import com.marklogic.spark.reader.file.TripleRowSchema;
2524
import com.marklogic.spark.reader.optic.SchemaInferrer;
2625
import com.marklogic.spark.writer.WriteContext;
2726
import org.apache.spark.sql.SparkSession;
@@ -64,7 +63,7 @@ public String shortName() {
6463
public StructType inferSchema(CaseInsensitiveStringMap options) {
6564
final Map<String, String> properties = options.asCaseSensitiveMap();
6665
if (isFileOperation(properties)) {
67-
return "rdf".equals(properties.get(Options.READ_FILES_TYPE)) ? TripleRowSchema.SCHEMA : FileRowSchema.SCHEMA;
66+
return FileRowSchema.SCHEMA;
6867
}
6968
if (isReadDocumentsOperation(properties)) {
7069
return DocumentRowSchema.SCHEMA;
@@ -86,7 +85,8 @@ public Table getTable(StructType schema, Transform[] partitioning, Map<String, S
8685

8786
if (isReadDocumentsOperation(properties)) {
8887
return new DocumentTable();
89-
} else if (isReadOperation(properties)) {
88+
}
89+
else if (isReadOperation(properties)) {
9090
if (logger.isDebugEnabled()) {
9191
logger.debug("Creating new table for reading");
9292
}

src/main/java/com/marklogic/spark/Options.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public abstract class Options {
5555
public static final String READ_DOCUMENTS_TRANSFORM_PARAMS_DELIMITER = "spark.marklogic.read.documents.transformParamsDelimiter";
5656
public static final String READ_DOCUMENTS_PARTITIONS_PER_FOREST = "spark.marklogic.read.documents.partitionsPerForest";
5757

58-
public static final String READ_FILES_TYPE = "spark.marklogic.read.files.type";
5958
public static final String READ_FILES_COMPRESSION = "spark.marklogic.read.files.compression";
6059

6160
// "Aggregate" = an XML document containing N child elements, each of which should become a row / document.

src/main/java/com/marklogic/spark/reader/document/DocumentRowSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
public abstract class DocumentRowSchema {
77

88
public static final StructType SCHEMA = new StructType()
9-
.add("URI", DataTypes.StringType, false)
9+
.add("URI", DataTypes.StringType)
1010
.add("content", DataTypes.BinaryType)
1111
.add("format", DataTypes.StringType)
1212
.add("collections", DataTypes.createArrayType(DataTypes.StringType))

src/main/java/com/marklogic/spark/reader/file/FilePartitionReaderFactory.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@ class FilePartitionReaderFactory implements PartitionReaderFactory {
2525
@Override
2626
public PartitionReader<InternalRow> createReader(InputPartition partition) {
2727
FilePartition filePartition = (FilePartition) partition;
28-
2928
String compression = this.properties.get(Options.READ_FILES_COMPRESSION);
3029
final boolean isZip = "zip".equalsIgnoreCase(compression);
3130
final boolean isGzip = "gzip".equalsIgnoreCase(compression);
3231

33-
if ("rdf".equalsIgnoreCase(this.properties.get(Options.READ_FILES_TYPE))) {
34-
return new RdfFileReader(filePartition, hadoopConfiguration);
35-
}
36-
3732
String aggregateXmlElement = this.properties.get(Options.READ_AGGREGATES_XML_ELEMENT);
3833
if (aggregateXmlElement != null && !aggregateXmlElement.trim().isEmpty()) {
3934
if (isZip) {

src/main/java/com/marklogic/spark/reader/file/FileRowSchema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ public abstract class FileRowSchema {
88
// Same as Spark's binaryType.
99
// See https://spark.apache.org/docs/latest/sql-data-sources-binaryFile.html .
1010
public static final StructType SCHEMA = new StructType()
11-
.add("path", DataTypes.StringType, false)
11+
.add("path", DataTypes.StringType)
1212
.add("modificationTime", DataTypes.TimestampType)
1313
.add("length", DataTypes.LongType)
14-
.add("content", DataTypes.BinaryType, false);
14+
.add("content", DataTypes.BinaryType);
1515

1616
private FileRowSchema() {
1717
}

src/main/java/com/marklogic/spark/reader/file/RdfFileReader.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/main/java/com/marklogic/spark/reader/file/TripleRowSchema.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main/java/com/marklogic/spark/reader/file/TripleSerializer.java

Lines changed: 0 additions & 100 deletions
This file was deleted.

src/test/java/com/marklogic/spark/reader/file/ReadRdfFilesTest.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)