@Test public void testViewWithoutTypes() throws Exception { String ddl = "CREATE FOREIGN TABLE G1(\n" + "e1 integer primary key,\n" + "e2 varchar(10) unique,\n" + "e3 date not null unique,\n" + "e4 decimal(12,3) default 12.2 options (searchable 'unsearchable'),\n" + "e5 integer auto_increment INDEX OPTIONS (UUID 'uuid', NAMEINSOURCE 'nis', SELECTABLE 'NO'),\n" + "e6 varchar index default 'hello')\n" + "OPTIONS (CARDINALITY 12, UUID 'uuid2', UPDATABLE 'true', FOO 'BAR', ANNOTATION 'Test Table'); " + " create view v1 as select G1.*, 'a' from G1;"; buildModel("phy1", true, this.vdb, this.store, ddl); buildTransformationMetadata(); ValidatorReport report = new MetadataValidator().validate(this.vdb, this.store); assertFalse(printError(report), report.hasItems()); Table table = store.getSchema("phy1").getTable("v1"); assertTrue(table.isVirtual()); assertFalse(table.isSystem()); assertFalse(table.isMaterialized()); assertFalse(table.isDeletePlanEnabled()); assertFalse(table.supportsUpdate()); assertEquals(6, table.getColumns().size()); List<Column> columns = table.getColumns(); Column e1 = columns.get(0); Column e2 = columns.get(1); Column e3 = columns.get(2); Column e4 = columns.get(3); Column e6 = columns.get(4); Column e7 = columns.get(5); assertEquals("e1", e1.getName()); assertEquals("integer", e1.getDatatype().getName()); assertEquals("e2", e2.getName()); assertEquals("string", e2.getDatatype().getName()); assertEquals(NullType.Nullable, e2.getNullType()); assertEquals(10, e2.getLength()); assertEquals(0, e2.getPrecision()); assertEquals("e3", e3.getName()); assertEquals("date", e3.getDatatype().getName()); assertEquals(NullType.No_Nulls, e3.getNullType()); assertEquals("e4", e4.getName()); assertEquals("bigdecimal", e4.getDatatype().getName()); assertEquals(false, e4.isAutoIncremented()); assertEquals(12, e4.getPrecision()); assertEquals(3, e4.getScale()); assertEquals(SearchType.Searchable, e4.getSearchType()); assertEquals(null, e4.getDefaultValue()); assertEquals("e6", e6.getName()); assertEquals("string", e6.getDatatype().getName()); assertEquals("expr2", e7.getName()); assertEquals("string", e7.getDatatype().getName()); assertEquals(1, e7.getLength()); }
public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } MetadataValidator(Map<String, Datatype> typeMap, QueryParser parser);  MetadataValidator(); }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } MetadataValidator(Map<String, Datatype> typeMap, QueryParser parser);  MetadataValidator(); ValidatorReport validate(VDBMetaData vdb, MetadataStore store); void log(ValidatorReport report, ModelMetaData model, String msg); void log(ValidatorReport report, ModelMetaData model, String msg, AbstractMetadataRecord object); void log(ValidatorReport report, ModelMetaData model, Severity severity, String msg, AbstractMetadataRecord object); void validate(VDBMetaData vdb, ModelMetaData model, AbstractMetadataRecord record, ValidatorReport report,
            QueryMetadataInterface metadata, MetadataFactory mf, QueryParser parser); static void determineDependencies(AbstractMetadataRecord p, Command command); }
MetadataValidator { public ValidatorReport validate(VDBMetaData vdb, MetadataStore store) { ValidatorReport report = new ValidatorReport(); if (store != null && !store.getSchemaList().isEmpty()) { new SourceModelArtifacts().execute(vdb, store, report, this); new CrossSchemaResolver().execute(vdb, store, report, this); new ResolveQueryPlans().execute(vdb, store, report, this); new MinimalMetadata().execute(vdb, store, report, this); new MatViewPropertiesValidator().execute(vdb, store, report, this); new RoleValidator().execute(vdb, store, report, this); } return report; } MetadataValidator(Map<String, Datatype> typeMap, QueryParser parser);  MetadataValidator(); ValidatorReport validate(VDBMetaData vdb, MetadataStore store); void log(ValidatorReport report, ModelMetaData model, String msg); void log(ValidatorReport report, ModelMetaData model, String msg, AbstractMetadataRecord object); void log(ValidatorReport report, ModelMetaData model, Severity severity, String msg, AbstractMetadataRecord object); void validate(VDBMetaData vdb, ModelMetaData model, AbstractMetadataRecord record, ValidatorReport report,
            QueryMetadataInterface metadata, MetadataFactory mf, QueryParser parser); static void determineDependencies(AbstractMetadataRecord p, Command command); static final String UNTYPED; }