diff --git a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/TableWriter.java b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/TableWriter.java index cd18bccd..cddd3f00 100644 --- a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/TableWriter.java +++ b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/TableWriter.java @@ -131,12 +131,6 @@ void write(T tm, OutputStream out) void write(T tm, OutputStream out, Long maxrec) throws IOException; - void write(T tm, Writer out) - throws IOException; - - void write(T tm, Writer out, Long maxrec) - throws IOException; - /** * Write the Throwable to the OutputStream * diff --git a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriter.java b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriter.java index d5b77440..7406c694 100644 --- a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriter.java +++ b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriter.java @@ -194,13 +194,11 @@ public void write(VOTableDocument vot, OutputStream out, Long maxrec) write(vot, writer, maxrec); } - @Override public void write(VOTableDocument vot, Writer out) throws IOException { write(vot, out, null); } - @Override public void write(VOTableDocument votable, Writer writer, Long maxrec) throws IOException { if (formatFactory == null) { diff --git a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/parquet/ParquetWriter.java b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/parquet/ParquetWriter.java index 0e904d8e..73221e86 100644 --- a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/parquet/ParquetWriter.java +++ b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/parquet/ParquetWriter.java @@ -78,7 +78,8 @@ public void write(VOTableDocument voTableDocument, OutputStream out, Long maxRec votableWriter.write(voTableDocument, stringWriter, maxRec); Map customMetaData = new HashMap<>(); - customMetaData.put("votable", stringWriter.toString()); + customMetaData.put("IVOA.VOTable-Parquet.version", "1.0"); + customMetaData.put("IVOA.VOTable-Parquet.content", stringWriter.toString()); try (org.apache.parquet.hadoop.ParquetWriter writer = AvroParquetWriter.builder(outputFile) .withSchema(schema) @@ -117,16 +118,6 @@ public void write(VOTableDocument voTableDocument, OutputStream out, Long maxRec out.close(); } - @Override - public void write(VOTableDocument voTableDocument, Writer out) { - throw new UnsupportedOperationException("This method for Parquet Writer is not supported."); - } - - @Override - public void write(VOTableDocument voTableDocument, Writer out, Long maxRec) { - throw new UnsupportedOperationException("This method for Parquet Writer is not supported."); - } - @Override public void write(Throwable thrown, OutputStream output) throws IOException { throw new UnsupportedOperationException("This method for Parquet Writer is not yet supported."); diff --git a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/votable/VOTableWriter.java b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/votable/VOTableWriter.java index 07016907..06653bc7 100644 --- a/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/votable/VOTableWriter.java +++ b/cadc-dali/src/main/java/ca/nrc/cadc/dali/tables/votable/VOTableWriter.java @@ -211,7 +211,6 @@ public void write(VOTableDocument votable, OutputStream ostream, Long maxrec) * @param writer Writer to write to. * @throws IOException if problem writing to the writer. */ - @Override public void write(VOTableDocument votable, Writer writer) throws IOException { write(votable, writer, Long.MAX_VALUE); @@ -227,7 +226,6 @@ public void write(VOTableDocument votable, Writer writer) * @param maxrec maximum number of rows to write. * @throws IOException if problem writing to the writer. */ - @Override public void write(VOTableDocument votable, Writer writer, Long maxrec) throws IOException { if (formatFactory == null) { diff --git a/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriterTest.java b/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriterTest.java index 51e4cc3a..8b3d5524 100644 --- a/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriterTest.java +++ b/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/ascii/AsciiTableWriterTest.java @@ -137,7 +137,7 @@ public void testReadWriteCSV() vot.setTableData(new VOTableReaderWriterTest.TestTableData()); StringWriter sw = new StringWriter(); - TableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.CSV); + AsciiTableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.CSV); Assert.assertEquals("Should be csv extension.", "csv", writer.getExtension()); @@ -181,7 +181,7 @@ public void testReadWriteCSV_NoFields() vot.setTableData(new VOTableReaderWriterTest.TestTableData()); StringWriter sw = new StringWriter(); - TableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.CSV); + AsciiTableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.CSV); Assert.assertEquals("Should be csv extension.", "csv", writer.getExtension()); @@ -225,7 +225,7 @@ public void testReadWriteTSV() vot.setTableData(new VOTableReaderWriterTest.TestTableData()); StringWriter sw = new StringWriter(); - TableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.TSV); + AsciiTableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.TSV); Assert.assertEquals("Should be tsv extension.", "tsv", writer.getExtension()); @@ -270,7 +270,7 @@ public void testReadWriteWithMax() vot.setTableData(new VOTableReaderWriterTest.TestTableData(maxrec + 1)); StringWriter sw = new StringWriter(); - TableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.CSV); + AsciiTableWriter writer = new AsciiTableWriter(AsciiTableWriter.ContentType.CSV); Assert.assertEquals("Should be csv extension.", "csv", writer.getExtension()); diff --git a/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/votable/VOTableReaderWriterTest.java b/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/votable/VOTableReaderWriterTest.java index 91268ad2..d4e9dfdd 100644 --- a/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/votable/VOTableReaderWriterTest.java +++ b/cadc-dali/src/test/java/ca/nrc/cadc/dali/tables/votable/VOTableReaderWriterTest.java @@ -155,7 +155,7 @@ public void testReadWriteVOTable() throws Exception { // Write VOTable to xml. StringWriter sw = new StringWriter(); - TableWriter writer = new VOTableWriter(); + VOTableWriter writer = new VOTableWriter(); writer.write(expected, sw); String xml = sw.toString(); log.debug("XML: \n\n" + xml); @@ -206,7 +206,7 @@ public void testReadWriteVOTableWithMax() throws Exception { // Write VOTable to xml. StringWriter sw = new StringWriter(); - TableWriter writer = new VOTableWriter(); + VOTableWriter writer = new VOTableWriter(); writer.write(expected, sw, maxrec); String xml = sw.toString(); log.info("XML: \n\n" + xml); @@ -254,7 +254,7 @@ public void testReadWriteVOTableWithIterationFail() throws Exception { // Write VOTable to xml. StringWriter sw = new StringWriter(); - TableWriter writer = new VOTableWriter(); + VOTableWriter writer = new VOTableWriter(); writer.setFormatFactory(new BrokenFormatFactory()); writer.write(expected, sw); String xml = sw.toString(); @@ -375,7 +375,7 @@ public void testReadWriteVOTableArraysize() throws Exception { // Write VOTable to xml. StringWriter sw = new StringWriter(); - TableWriter writer = new VOTableWriter(); + VOTableWriter writer = new VOTableWriter(); writer.write(expected, sw); String xml = sw.toString(); log.debug("XML: \n\n" + xml);