zachjsh commented on code in PR #15469:
URL: https://github.com/apache/druid/pull/15469#discussion_r1418509963
##########
sql/src/main/java/org/apache/druid/sql/calcite/table/DatasourceTable.java:
##########
@@ -115,14 +137,107 @@ public String toString()
}
}
+ public static class EffectiveColumnMetadata
+ {
+ protected final String name;
+ protected final ColumnType type;
+
+ public EffectiveColumnMetadata(String name, ColumnType type)
+ {
+ this.name = name;
+ this.type = type;
+ }
+
+ public String name()
+ {
+ return name;
+ }
+
+ public ColumnType druidType()
+ {
+ return type;
+ }
+
+ public static EffectiveColumnMetadata fromPhysical(String name, ColumnType
type)
+ {
+ return new EffectiveColumnMetadata(name, type);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Column{" +
+ "name=" + name +
+ ", type=" + type.asTypeString() +
+ "}";
+ }
+ }
+
+ public static class EffectiveMetadata
+ {
+ private final DatasourceFacade catalogMetadata;
+ private final boolean isEmpty;
+ private final Map<String, EffectiveColumnMetadata> columns;
+
+ public EffectiveMetadata(
+ final DatasourceFacade catalogMetadata,
+ final Map<String, EffectiveColumnMetadata> columns,
+ final boolean isEmpty
+ )
+ {
+ this.catalogMetadata = catalogMetadata;
+ this.isEmpty = isEmpty;
+ this.columns = columns;
+ }
+
+ public DatasourceFacade catalogMetadata()
+ {
+ return catalogMetadata;
+ }
+
+ public EffectiveColumnMetadata column(String name)
+ {
+ return columns.get(name);
+ }
+
+ public boolean isEmpty()
Review Comment:
Does isEmpty signify whether or not the table had any data in it or not?
--
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]