[ 
https://issues.apache.org/jira/browse/DRILL-6361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464289#comment-16464289
 ] 

ASF GitHub Bot commented on DRILL-6361:
---------------------------------------

vvysotskyi commented on a change in pull request #1242: DRILL-6361: Added 
typeOf() function variations
URL: https://github.com/apache/drill/pull/1242#discussion_r186185398
 
 

 ##########
 File path: common/src/main/java/org/apache/drill/common/types/Types.java
 ##########
 @@ -173,6 +177,48 @@ public static String getSqlTypeName(final MajorType type) 
{
     }
   }
 
+  /**
+   * Extend decimal type with precision and scale.
+   *
+   * @param type major type
+   * @param typeName type converted to a string
+   * @return type name augmented with precision and scale,
+   * if type is a decimal
+   */
+
+  public static String getExtendedSqlTypeName(MajorType type) {
+
+    String typeName = getSqlTypeName(type);
+    switch (type.getMinorType()) {
+    case DECIMAL9:
+    case DECIMAL18:
+    case DECIMAL28SPARSE:
+    case DECIMAL28DENSE:
+    case DECIMAL38SPARSE:
+    case DECIMAL38DENSE:
+      // Disabled for now. See DRILL-6378
 
 Review comment:
   Could you please remove this comment, since DRILL-6378 was fixed in the 
scope of DRILL-6094?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Provide sqlTypeOf() and modeOf() functions
> ------------------------------------------
>
>                 Key: DRILL-6361
>                 URL: https://issues.apache.org/jira/browse/DRILL-6361
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.13.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>            Priority: Minor
>              Labels: doc-impacting
>             Fix For: 1.14.0
>
>
> Drill provides a {{typeof()}} function to return the type of a column. The 
> returned string, however, has only the base data type. A Drill data type (a 
> "major type") also includes a cardinality (a "mode"). For example, {{Optional 
> Int}} or {{Required VarChar}}.
> This type information is useful for handling data conversions. For example, 
> if I could tell that a column value was a {{Nullable Int}}, I could guess 
> that it is one Drill invented, and I could merge it, by hand, with the type 
> from another file that had actual values.
> The two options are equivalent. Either provide a {{modeOf()}} to just return 
> cardinality, or a {{dataTypeOf()}} that returns both. (Maybe the {{modeOf()}} 
> might be more useful.)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to