Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vlsi
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlsi/c9142d16bf5177da8ca6 to your computer and use it in GitHub Desktop.
Save vlsi/c9142d16bf5177da8ca6 to your computer and use it in GitHub Desktop.
bash-3.2$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building calite-map-demo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scala-maven-plugin:3.1.6:add-source (scala-compile-first) @ calite-map-demo ---
[INFO] Add Source directory: /Users/vladimirsitnikov/Documents/work/calcite-map-demo/src/main/scala
[INFO] Add Test Source directory: /Users/vladimirsitnikov/Documents/work/calcite-map-demo/src/test/scala
[INFO]
[INFO] --- scala-maven-plugin:3.1.6:compile (scala-compile-first) @ calite-map-demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default) @ calite-map-demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scala-maven-plugin:3.1.6:testCompile (scala-test-compile) @ calite-map-demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ calite-map-demo ---
Discovery starting.
Discovery completed in 408 milliseconds.
Run starting. Expected test count is: 2
TestMapCalcite:
/* 1 */ net.hydromatic.optiq.DataContext root;
/* 2 */
/* 3 */ public net.hydromatic.linq4j.Enumerable bind(final net.hydromatic.optiq.DataContext root0) {
/* 4 */ root = root0;
/* 5 */ return ((devth.calcite.MapTable) root.getRootSchema().getSubSchema("foo").getTable("foo")).project(net.hydromatic.optiq.runtime.FlatLists.of(new String[] {
/* 6 */ "name"}));
/* 7 */ }
/* 8 */
/* 9 */
/* 10 */ public java.lang.reflect.Type getElementType() {
/* 11 */ return java.util.Map.class;
/* 12 */ }
/* 13 */
/* 14 */
22:42:54.958 [ScalaTest-main-running-TestMapCalcite] INFO devth.calcite.MapEnumerator - MapEnumerator with fields [name]
{name=foo, address={city=seattle, state=wa, coords={lat=47.609722, long=-122.333056}}}
{name=bar, address={city=denver, state=co}}
{name=baz, address={city=chicago, state=il}}
{name=qux, address={city=san francisco, state=ca}}
{name=norf, address={city=new york city, state=ny}}
- Select everything: select * from "foo"."foo"
/* 1 */ net.hydromatic.optiq.DataContext root;
/* 2 */
/* 3 */ public net.hydromatic.linq4j.Enumerable bind(final net.hydromatic.optiq.DataContext root0) {
/* 4 */ root = root0;
/* 5 */ return ((devth.calcite.MapTable) root.getRootSchema().getSubSchema("foo").getTable("foo")).project(net.hydromatic.optiq.runtime.FlatLists.of(new String[] {
/* 6 */ "name"}));
/* 7 */ }
/* 8 */
/* 9 */
/* 10 */ public java.lang.reflect.Type getElementType() {
/* 11 */ return java.lang.Object[].class;
/* 12 */ }
/* 13 */
/* 14 */
22:42:54.995 [ScalaTest-main-running-TestMapCalcite] INFO devth.calcite.MapEnumerator - MapEnumerator with fields [name]
- Select a few things: select _MAP['name'], _MAP['address']['city'] from "foo"."foo" *** FAILED ***
java.lang.ClassCastException: scala.collection.convert.Wrappers$MapWrapper cannot be cast to [Ljava.lang.Object;
at net.hydromatic.optiq.runtime.ArrayEnumeratorCursor$ArrayEnumeratorGetter.getObject(ArrayEnumeratorCursor.java:50)
at net.hydromatic.optiq.runtime.AbstractCursor$AccessorImpl.getObject(AbstractCursor.java:279)
at net.hydromatic.optiq.runtime.AbstractCursor$AccessorImpl.getString(AbstractCursor.java:222)
at net.hydromatic.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:204)
at devth.calcite.TestMapCalcite$$anonfun$3.apply(TestMapCalcite.scala:53)
at devth.calcite.TestMapCalcite$$anonfun$3.apply(TestMapCalcite.scala:52)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.immutable.Range.foreach(Range.scala:160)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
...
Run completed in 1 second, 317 milliseconds.
Total number of tests run: 2
Suites: completed 2, aborted 0
Tests: succeeded 1, failed 1, canceled 0, ignored 0, pending 0
*** 1 TEST FAILED ***
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.111 s
[INFO] Finished at: 2014-11-25T22:42:55+03:00
[INFO] Final Memory: 11M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.scalatest:scalatest-maven-plugin:1.0:test (test) on project calite-map-demo: There are test failures -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
...
<!-- disable surefire -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<!-- enable scalatest -->
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<systemProperties>
<calcite.debug>true</calcite.debug>
</systemProperties>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>WDF TestSuite.txt</filereports>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment