[teiid-issues] [JBoss JIRA] (TEIID-4912) DDL VDB doesn't support CREATE GLOBAL TEMPORARY TABLE
Steven Hawkins (JIRA)
issues at jboss.org
Wed May 17 09:18:00 EDT 2017
[ https://issues.jboss.org/browse/TEIID-4912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407750#comment-13407750 ]
Steven Hawkins commented on TEIID-4912:
---------------------------------------
The ddl is not complete. There is some boilerplate that is needed for SQL compliance, and you still need to create the table as part of a schema:
CREATE DATABASE Portfolio;
USE DATABASE Portfolio;
CREATE VIRTUAL SCHEMA Sample;
SET SCHEMA Sample;
CREATE GLOBAL TEMPORARY TABLE GTEMP (id SERIAL, name string, PRIMARY KEY (id)) OPTIONS (UPDATABLE 'true');
> Also, is there a validate api to validate the ddl like xml validation?
Nothing concise yet. The analogous logic is in VDBParserDeployer.parseVDBDDL
> DDL VDB doesn't support CREATE GLOBAL TEMPORARY TABLE
> -----------------------------------------------------
>
> Key: TEIID-4912
> URL: https://issues.jboss.org/browse/TEIID-4912
> Project: Teiid
> Issue Type: Quality Risk
> Affects Versions: 9.3
> Reporter: Kylin Soong
> Assignee: Steven Hawkins
> Fix For: 10.0
>
>
> I tried to deploy VDB via ddl via embedded server, my ddl looks
> {code}
> CREATE DATABASE Portfolio;
> CREATE GLOBAL TEMPORARY TABLE GTEMP (id SERIAL, name string, PRIMARY KEY (id)) OPTIONS (UPDATABLE 'true');
> {code}
> But the deployment failed with trace:
> {code}
> Exception in thread "main" org.teiid.metadata.ParseException: TEIID31259 In the statement ending with token GTEMP on line 2 column 31 the ddl is not valid: TEIID31246 No database in context; Try using "create database ..." or "use database ..." first.
> at org.teiid.query.parser.QueryParser.parseDDL(QueryParser.java:567)
> at org.teiid.metadatastore.DeploymentBasedDatabaseStore.getVDBMetadata(DeploymentBasedDatabaseStore.java:79)
> at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:738)
> at org.teiid.test.teiid4911.TEIID4911.main(TEIID4911.java:32)
> Caused by: org.teiid.metadata.MetadataException: TEIID31246 No database in context; Try using "create database ..." or "use database ..." first.
> at org.teiid.query.metadata.DatabaseStore.getCurrentDatabase(DatabaseStore.java:405)
> at org.teiid.query.metadata.DatabaseStore.createMF(DatabaseStore.java:844)
> at org.teiid.query.parser.SQLParser.createTable(SQLParser.java:14002)
> at org.teiid.query.parser.SQLParser.ddlStmt(SQLParser.java:12596)
> at org.teiid.query.parser.SQLParser.parseMetadata(SQLParser.java:12577)
> at org.teiid.query.parser.QueryParser.parseDDL(QueryParser.java:561)
> ... 3 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the teiid-issues
mailing list