You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Aaron Dossett (JIRA)" <ji...@apache.org> on 2016/08/24 18:02:21 UTC

[jira] [Created] (CALCITE-1360) ModelHandler won't accept a file name without a directory component

Aaron Dossett created CALCITE-1360:
--------------------------------------

             Summary: ModelHandler won't accept a file name without a directory component
                 Key: CALCITE-1360
                 URL: https://issues.apache.org/jira/browse/CALCITE-1360
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.8.0
            Reporter: Aaron Dossett
            Assignee: Julian Hyde
            Priority: Trivial


A model referencing file with no directory component throws an NPE. In the example below replacing {code}foo.json{code} with {code}./foo.json{code} resolves the problem.

{code}sqlline> !connect jdbc:calcite:model=foo.json druid druid
java.lang.RuntimeException: Error instantiating JsonCustomSchema(name=foo)
	at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:219)
	at org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45)
	at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:142)
	at org.apache.calcite.model.ModelHandler.<init>(ModelHandler.java:84)
	at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104)
	at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:145)
	at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)
	at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)
	at sqlline.Commands.connect(Commands.java:1064)
	at sqlline.Commands.connect(Commands.java:996)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
	at sqlline.SqlLine.dispatch(SqlLine.java:803)
	at sqlline.SqlLine.begin(SqlLine.java:681)
	at sqlline.SqlLine.start(SqlLine.java:398)
	at sqlline.SqlLine.main(SqlLine.java:292)
Caused by: java.lang.NullPointerException: null value in entry: baseDirectory=null
	at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)
	at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:135)
	at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:206)
	at org.apache.calcite.model.ModelHandler.operandMap(ModelHandler.java:240)
	at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:215)
	... 18 more
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)