[
https://issues.apache.org/jira/browse/TRAFODION-2060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15334275#comment-15334275
]
ASF GitHub Bot commented on TRAFODION-2060:
-------------------------------------------
Github user anoopsharma00 commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/545#discussion_r67391298
--- Diff: core/sql/common/BaseTypes.cpp ---
@@ -412,6 +419,13 @@ short convertTypeToText_basic(char * text, //
OUTPUT
str_sprintf(text, "NUMERIC(%d, %d) UNSIGNED", precision, scale);
break;
+ case REC_BIN8_UNSIGNED:
+ if (!precision)
+ str_sprintf(text, "TINYINT UNSIGNED");
+ else
+ str_sprintf(text, "NUMERIC(%d, %d)", precision, scale);
--- End diff --
At current time, NUMERIC datatypes are handled as smallint, int or largeint.
They are not converted to tinyint. That could be done at some point.
So this code will not be reached.
But review comment is correct about this code being incorrect and I have
fixed it.
If we do enhance NUMERIC with precision <= 2 to be treated as tinyint, then
this code will be exercised.
> Add support for native tinyint datatype
> ---------------------------------------
>
> Key: TRAFODION-2060
> URL: https://issues.apache.org/jira/browse/TRAFODION-2060
> Project: Apache Trafodion
> Issue Type: Improvement
> Reporter: Anoop Sharma
> Assignee: Anoop Sharma
> Priority: Minor
>
> Currently, tinyint datatype(1 byte integer) in trafodion is automatically
> converted to smallint (2 byte integer) and treated like smallint.
> It causes values that are beyond the tinyint range to be inserted
> and selected.
> Same issue happens with hive tinyint datatypes which are also
> treated as smallint. That causes inconsistent behavior when that
> datatype is accessed or inserted from hive vs. trafodion.
> This jira is to add support for true tinyint datatype in table definitions,
> cast stmts, param typing and handling of hive tables.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)