clintropolis commented on code in PR #17803:
URL: https://github.com/apache/druid/pull/17803#discussion_r2022407512
##########
server/src/main/java/org/apache/druid/catalog/model/ResolvedTable.java:
##########
@@ -84,6 +84,15 @@ public Map<String, Object> properties()
return spec.properties();
}
+ public <T> T getProperty(String key)
Review Comment:
fair, renamed to `decodeProperty` which i think resolves the problem
##########
server/src/main/java/org/apache/druid/catalog/model/table/DatasourceDefn.java:
##########
@@ -70,13 +73,48 @@ public class DatasourceDefn extends TableDefn
public static final String TABLE_TYPE = "datasource";
+ public DatasourceDefn()
+ {
+ super(
+ "Datasource",
+ TABLE_TYPE,
+ Arrays.asList(
+ new SegmentGranularityFieldDefn(),
+ new ModelProperties.IntPropertyDefn(TARGET_SEGMENT_ROWS_PROPERTY),
+ new ClusterKeysDefn(),
+ new HiddenColumnsDefn(),
+ new ModelProperties.BooleanPropertyDefn(SEALED_PROPERTY),
+ new ProjectionsDefn()
+ ),
+ null
+ );
+ }
+
+ @Override
+ protected void validateColumn(ColumnSpec spec)
+ {
+ super.validateColumn(spec);
+ if (Columns.isTimeColumn(spec.name()) && spec.dataType() != null) {
+ // Validate type in next PR
+ }
+ }
+
+ public static boolean isDatasource(String tableType)
Review Comment:
i just shuffled some stuff around, this isn't a new method, but agree it
could use some javadocs. This method only seems to be used by `TableEditor`,
and also is always inverted (it is validating that catalog hidden column
modifications are only applied to 'datasource' typed specs. I'll just add a
note for now that the expected strings arguments are from `TableSpec.type`, but
it does seem like this could be reworked to do this differently (same with the
instanceOf version right below it)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]