Hello everyone,
I just submitted a PR for a format plugin for Syslog formatted data. I’m
really stuck on writing a unit test however and could use some assistance.
Basically I’m stuck writing a unit test where the data returns a map. I
attempted to follow the sample code shown below, however, Java doesn’t seem to
be finding the build() or buildMap() functions and hence the unit test doesn’t
work.
<p>
* Code:<pre><code>
* BatchSchema batchSchema = new SchemaBuilder()
* .add("c", MinorType.INT)
* .addMap("a")
* .addNullable("b", MinorType.VARCHAR)
* .add("d", MinorType.INT)
* .addMap("e") // or .addMapArray("e")
* .add("f", MinorType.VARCHAR)
* .buildMap()
* .add("g", MinorType.INT)
* .buildMap()
* .addUnion("h") // or .addList("h")
* .addType(MinorType.INT)
* .addMap()
* .add("h1", MinorType.INT)
* .buildNested()
* .addList()
* .addType(MinorType.BIGINT)
* .buildNested()
* .build()
* .addArray("i", MinorType.BIGINT)
* .addRepeatedList("j")
* .addDimension()
* .addArray(MinorType.VARCHAR)
* .endDimension()
* .build()
* .build();
* </code</pre>
However, it would not work. The test file can be found here:
https://github.com/apache/drill/blob/a2365042ee0baa73698f1bb9dd183bb4623bc254/contrib/format-syslog/src/test/java/org/apache/drill/exec/store/syslog/TestSyslogFormat.java
<https://github.com/apache/drill/blob/a2365042ee0baa73698f1bb9dd183bb4623bc254/contrib/format-syslog/src/test/java/org/apache/drill/exec/store/syslog/TestSyslogFormat.java>.
I commented out the non-working test. Any help would be greatly
appreciated.
Thanks!
—C