You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/11/09 01:01:20 UTC

[GitHub] [druid] clintropolis opened a new pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

clintropolis opened a new pull request #11895:
URL: https://github.com/apache/druid/pull/11895


   
   ### Description
   #11713 changed the segment metadata query column analysis `type` field, but this might not be very friendly to non Druid-schema users who are calling this query directly because, merging query results of mixed versions of Druid would result in an error due to mismatched types. 
   
   This PR reverts `type` to its original behavior, and adds a new `typeSignature` which is used by `DruidSchema`. Error messaging when merging `ColumnAnalysis` has also been improved to include the mismatched types involved in the merge.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `ColumnAnalysis`
    * `SegmentAnalyzer`
   
   <hr>
   
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added documentation for new or modified features or behaviors.
   - [x] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] been tested in a test Druid cluster.
   


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] lgtm-com[bot] commented on pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
lgtm-com[bot] commented on pull request #11895:
URL: https://github.com/apache/druid/pull/11895#issuecomment-964695982


   This pull request **introduces 2 alerts** when merging 9055810aa5eb60b0703f9b63dd93a84a0c77cb9e into 6c196a5ea2100b5b5c5e81fe75b30ad5d3a63f83 - [view on LGTM.com](https://lgtm.com/projects/g/apache/druid/rev/pr-6c826898e9a511084e46818e74d0511f881cfe38)
   
   **new alerts:**
   
   * 2 for Dereferenced variable may be null


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] abhishekagarwal87 commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
abhishekagarwal87 commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745480177



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -47,6 +50,7 @@ public static ColumnAnalysis error(String reason)
 
   @JsonCreator
   public ColumnAnalysis(
+      @JsonProperty("typeSignature") ColumnType typeSignature,

Review comment:
       https://github.com/apache/druid/pull/11895/files#diff-5aa1494dc5a13e82654e42ce8cdb3cb628c95233f8828312b3ede40dac1b8544R156 - shall this be modified to pick the one if the other is null instead of throwing an error. I am throwing darts in the dark here so please ignore if this is not really a problem :) 




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] abhishekagarwal87 commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
abhishekagarwal87 commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745513689



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -47,6 +50,7 @@ public static ColumnAnalysis error(String reason)
 
   @JsonCreator
   public ColumnAnalysis(
+      @JsonProperty("typeSignature") ColumnType typeSignature,

Review comment:
       ah yes. you are right. thanks for clarifying. 




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] techdocsmith commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
techdocsmith commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745922925



##########
File path: docs/querying/segmentmetadataquery.md
##########
@@ -87,9 +87,11 @@ The format of the result is:
 } ]
 ```
 
-Dimension columns will have type `STRING`, `FLOAT`, `DOUBLE`, or `LONG`.
-Metric columns will have type `FLOAT`, `DOUBLE`, or `LONG`, or the name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
-Timestamp column will have type `LONG`.
+All columns contain a `typeSignature` that Druid uses to represent the column type information internally. The `typeSignature` is typically the same value used to identify the JSON type information at query or ingest time. One of: `STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>`, e.g. `COMPLEX<hyperUnique>`.
+
+Columns will also have a legacy `type` name. For some column types, the value may match the `typeSignature`  (`STRING`, `FLOAT`, `DOUBLE`, or `LONG`). For `COMPLEX` columns, the `type` only contains the name of the underlying complex type such as `hyperUnique`.

Review comment:
       ```suggestion
   Columns also have a legacy `type` name. For some column types, the value may match the `typeSignature`  (`STRING`, `FLOAT`, `DOUBLE`, or `LONG`). For `COMPLEX` columns, the `type` only contains the name of the underlying complex type such as `hyperUnique`.
   ```
   nit. avoid future




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745423064



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -47,6 +50,7 @@ public static ColumnAnalysis error(String reason)
 
   @JsonCreator
   public ColumnAnalysis(
+      @JsonProperty("typeSignature") ColumnType typeSignature,

Review comment:
       the supported upgrade order is brokers last, but it would just be null, which shouldn't be a problem i think




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745900585



##########
File path: docs/querying/segmentmetadataquery.md
##########
@@ -87,9 +87,11 @@ The format of the result is:
 } ]
 ```
 
-Dimension columns will have type `STRING`, `FLOAT`, `DOUBLE`, or `LONG`.
-Metric columns will have type `FLOAT`, `DOUBLE`, or `LONG`, or the name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
-Timestamp column will have type `LONG`.
+All columns contain a `typeSignature` that Druid uses to represent the column type information internally. The `typeSignature` is typically the same value used to identify the JSON type information at query or ingest time. One of: STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>`, e.g. `COMPLEX<hyperUnique>`.

Review comment:
       ```suggestion
   All columns contain a `typeSignature` that Druid uses to represent the column type information internally. The `typeSignature` is typically the same value used to identify the JSON type information at query or ingest time. One of: `STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>`, e.g. `COMPLEX<hyperUnique>`.
   ```




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] gianm commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
gianm commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745211540



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -73,6 +78,12 @@ public String getType()
     return type;
   }
 
+  @JsonProperty
+  public ColumnType getTypeSignature()

Review comment:
       Consider placing this getter above `getType`, which I think will put it earlier in the JSON and make it seem more "official".

##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -136,7 +147,19 @@ public ColumnAnalysis fold(ColumnAnalysis rhs)
     }
 
     if (!type.equals(rhs.getType())) {
-      return ColumnAnalysis.error("cannot_merge_diff_types");
+      return ColumnAnalysis.error(
+          StringUtils.format("cannot_merge_diff_types: [%s] and [%s]", type, rhs.getType())
+      );
+    }
+
+    if (!typeSignature.equals(rhs.getTypeSignature())) {

Review comment:
       This'll NPE if `typeSignature` is null — i.e. if it came from a server that is on an older version. I think this is OK, since people are supposed to update Brokers after segment-serving-servers, but I'd still feel better if this code was resilient to null `typeSignature`.
   
   Which reminds me: I think we'll also need a trivial change in the cache key to make sure SegmentAnalysis objects from shared caches are not re-used.

##########
File path: docs/querying/segmentmetadataquery.md
##########
@@ -87,9 +87,11 @@ The format of the result is:
 } ]
 ```
 
-Dimension columns will have type `STRING`, `FLOAT`, `DOUBLE`, or `LONG`.
-Metric columns will have type `FLOAT`, `DOUBLE`, or `LONG`, or the name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
-Timestamp column will have type `LONG`.
+All columns will contain a `typeSignature` which is the Druid internal representation of the type information for this column, is what is show in [`INFORMATION_SCHEMA.COLUMNS`](../querying/sql.md#columns-table) table in SQL, and is typically the value used to supply Druid with JSON type information at query or ingest time. This value will be `STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>` (e.g. `COMPLEX<hyperUnique>`).
+
+Additionally, columns will have a legacy friendly `type` name. This might match `typeSignature` for some column types (`STRING`, `FLOAT`, `DOUBLE`, or `LONG`) but for COMPLEX columns will only contain the name of the underlying complex type such as `hyperUnique`.

Review comment:
       Consider adding:
   
   > New applications should use `typeSignature`, not `type`.

##########
File path: docs/querying/segmentmetadataquery.md
##########
@@ -87,9 +87,11 @@ The format of the result is:
 } ]
 ```
 
-Dimension columns will have type `STRING`, `FLOAT`, `DOUBLE`, or `LONG`.
-Metric columns will have type `FLOAT`, `DOUBLE`, or `LONG`, or the name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
-Timestamp column will have type `LONG`.
+All columns will contain a `typeSignature` which is the Druid internal representation of the type information for this column, is what is show in [`INFORMATION_SCHEMA.COLUMNS`](../querying/sql.md#columns-table) table in SQL, and is typically the value used to supply Druid with JSON type information at query or ingest time. This value will be `STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>` (e.g. `COMPLEX<hyperUnique>`).

Review comment:
       show -> shown

##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -181,6 +205,7 @@ public String toString()
   {
     return "ColumnAnalysis{" +
            "type='" + type + '\'' +
+           ", columnType=" + typeSignature +

Review comment:
       Why not call this typeSignature?




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] suneet-s merged pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
suneet-s merged pull request #11895:
URL: https://github.com/apache/druid/pull/11895


   


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745496938



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -47,6 +50,7 @@ public static ColumnAnalysis error(String reason)
 
   @JsonCreator
   public ColumnAnalysis(
+      @JsonProperty("typeSignature") ColumnType typeSignature,

Review comment:
       ah, if we supported updating the broker before data servers then we might want to consider that, but we don't (so that new query types, filters, aggregators, etc cannot be issued before data servers can understand them)




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745215608



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -181,6 +205,7 @@ public String toString()
   {
     return "ColumnAnalysis{" +
            "type='" + type + '\'' +
+           ", columnType=" + typeSignature +

Review comment:
       oops, :+1:




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] lgtm-com[bot] commented on pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
lgtm-com[bot] commented on pull request #11895:
URL: https://github.com/apache/druid/pull/11895#issuecomment-963787145


   This pull request **introduces 2 alerts** when merging be1c2ba7e23b039fa055e08d1a45770632b45342 into a5bd0b8cc023b771ef95f1e46c19961f50e05900 - [view on LGTM.com](https://lgtm.com/projects/g/apache/druid/rev/pr-094954a3a21875fb1a1a8f057a094eb7f17fb926)
   
   **new alerts:**
   
   * 2 for Dereferenced variable may be null


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] abhishekagarwal87 commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
abhishekagarwal87 commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745406035



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -47,6 +50,7 @@ public static ColumnAnalysis error(String reason)
 
   @JsonCreator
   public ColumnAnalysis(
+      @JsonProperty("typeSignature") ColumnType typeSignature,

Review comment:
       can this change cause a problem during upgrade? E.g. an historical is on older version while broker is on newer version so the broker gets old json from the historical when running segment metadata queries? 




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
clintropolis commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745496938



##########
File path: processing/src/main/java/org/apache/druid/query/metadata/metadata/ColumnAnalysis.java
##########
@@ -47,6 +50,7 @@ public static ColumnAnalysis error(String reason)
 
   @JsonCreator
   public ColumnAnalysis(
+      @JsonProperty("typeSignature") ColumnType typeSignature,

Review comment:
       if we supported updating the broker before data servers then we might wan't to consider that, but we don't (so that new query types, filters, aggregators, etc cannot be issued before data servers can understand them)




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] techdocsmith commented on a change in pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
techdocsmith commented on a change in pull request #11895:
URL: https://github.com/apache/druid/pull/11895#discussion_r745231231



##########
File path: docs/querying/segmentmetadataquery.md
##########
@@ -87,9 +87,11 @@ The format of the result is:
 } ]
 ```
 
-Dimension columns will have type `STRING`, `FLOAT`, `DOUBLE`, or `LONG`.
-Metric columns will have type `FLOAT`, `DOUBLE`, or `LONG`, or the name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
-Timestamp column will have type `LONG`.
+All columns will contain a `typeSignature` which is the Druid internal representation of the type information for this column, is what is show in [`INFORMATION_SCHEMA.COLUMNS`](../querying/sql.md#columns-table) table in SQL, and is typically the value used to supply Druid with JSON type information at query or ingest time. This value will be `STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>` (e.g. `COMPLEX<hyperUnique>`).
+
+Additionally, columns will have a legacy friendly `type` name. This might match `typeSignature` for some column types (`STRING`, `FLOAT`, `DOUBLE`, or `LONG`) but for COMPLEX columns will only contain the name of the underlying complex type such as `hyperUnique`.
+
+The timestamp column will always have `typeSignature` and `type` as `LONG`.

Review comment:
       ```suggestion
   The `typeSignature` and `type` for the timestamp column is always `LONG`.
   ```

##########
File path: docs/querying/segmentmetadataquery.md
##########
@@ -87,9 +87,11 @@ The format of the result is:
 } ]
 ```
 
-Dimension columns will have type `STRING`, `FLOAT`, `DOUBLE`, or `LONG`.
-Metric columns will have type `FLOAT`, `DOUBLE`, or `LONG`, or the name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
-Timestamp column will have type `LONG`.
+All columns will contain a `typeSignature` which is the Druid internal representation of the type information for this column, is what is show in [`INFORMATION_SCHEMA.COLUMNS`](../querying/sql.md#columns-table) table in SQL, and is typically the value used to supply Druid with JSON type information at query or ingest time. This value will be `STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>` (e.g. `COMPLEX<hyperUnique>`).

Review comment:
       ```suggestion
   All columns contain a `typeSignature` that Druid uses to represent the column type information internally. The `typeSignature` is typically the same value used to identify the JSON type information at query or ingest time. One of: STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>`, e.g. `COMPLEX<hyperUnique>`.
   ```

##########
File path: docs/querying/segmentmetadataquery.md
##########
@@ -87,9 +87,11 @@ The format of the result is:
 } ]
 ```
 
-Dimension columns will have type `STRING`, `FLOAT`, `DOUBLE`, or `LONG`.
-Metric columns will have type `FLOAT`, `DOUBLE`, or `LONG`, or the name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
-Timestamp column will have type `LONG`.
+All columns will contain a `typeSignature` which is the Druid internal representation of the type information for this column, is what is show in [`INFORMATION_SCHEMA.COLUMNS`](../querying/sql.md#columns-table) table in SQL, and is typically the value used to supply Druid with JSON type information at query or ingest time. This value will be `STRING`, `FLOAT`, `DOUBLE`, `LONG`, or `COMPLEX<typeName>` (e.g. `COMPLEX<hyperUnique>`).
+
+Additionally, columns will have a legacy friendly `type` name. This might match `typeSignature` for some column types (`STRING`, `FLOAT`, `DOUBLE`, or `LONG`) but for COMPLEX columns will only contain the name of the underlying complex type such as `hyperUnique`.

Review comment:
       ```suggestion
   Druid retains the legacy friendly `type` name. For some column types, the value may match the `typeSignature`  (`STRING`, `FLOAT`, `DOUBLE`, or `LONG`). For `COMPLEX` columns, the `type` only contains the name of the underlying complex type such as `hyperUnique`.
   
   New applications should use `typeSignature`, not `type`.
   ```




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] lgtm-com[bot] commented on pull request #11895: revert ColumnAnalysis type, add typeSignature and use it for DruidSchema

Posted by GitBox <gi...@apache.org>.
lgtm-com[bot] commented on pull request #11895:
URL: https://github.com/apache/druid/pull/11895#issuecomment-963751937


   This pull request **introduces 2 alerts** when merging bff926e4f41172e7622427aa54d7e1538f6e115f into a5bd0b8cc023b771ef95f1e46c19961f50e05900 - [view on LGTM.com](https://lgtm.com/projects/g/apache/druid/rev/pr-ee950bec081f4bda8d1235061ea50d84ebff6c8b)
   
   **new alerts:**
   
   * 2 for Dereferenced variable may be null


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org