You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/07/13 01:19:00 UTC
[jira] [Commented] (TRAFODION-3136) Improve on split_part
builtin-function
[ https://issues.apache.org/jira/browse/TRAFODION-3136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542394#comment-16542394 ]
ASF GitHub Bot commented on TRAFODION-3136:
-------------------------------------------
GitHub user zlei929 opened a pull request:
https://github.com/apache/trafodion/pull/1642
[TRAFODION-3136] New featrue: improve on split_part builtin-function.
modified: core/sql/common/OperTypeEnum.h
modified: core/sql/exp/ExpPackDefs.cpp
modified: core/sql/exp/exp_clause.cpp
modified: core/sql/exp/exp_clause.h
modified: core/sql/exp/exp_function.cpp
modified: core/sql/exp/exp_function.h
modified: core/sql/generator/GenItemFunc.cpp
modified: core/sql/optimizer/ItemExpr.cpp
modified: core/sql/optimizer/ItemFunc.h
modified: core/sql/optimizer/SynthType.cpp
modified: core/sql/parser/ParKeyWords.cpp
modified: core/sql/parser/sqlparser.y
modified: core/sql/regress/core/EXPECTED038.LINUX
modified: core/sql/regress/core/TEST038
modified: docs/messages_guide/src/asciidoc/_chapters/binder_msgs.adoc
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zlei929/trafodion TRAFODION-3136
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1642.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1642
----
commit 2e26003eab6ba2cd2063ccd6ea55ba984ba5a5fb
Author: zlei929 <z_...@...>
Date: 2018-07-12T11:38:25Z
modified: core/sql/bin/SqlciErrors.txt
modified: core/sql/common/OperTypeEnum.h
modified: core/sql/exp/ExpPackDefs.cpp
modified: core/sql/exp/exp_clause.cpp
modified: core/sql/exp/exp_clause.h
modified: core/sql/exp/exp_function.cpp
modified: core/sql/exp/exp_function.h
modified: core/sql/generator/GenItemFunc.cpp
modified: core/sql/optimizer/ItemExpr.cpp
modified: core/sql/optimizer/ItemFunc.h
modified: core/sql/optimizer/SynthType.cpp
modified: core/sql/parser/ParKeyWords.cpp
modified: core/sql/parser/sqlparser.y
modified: core/sql/regress/core/EXPECTED038.LINUX
modified: core/sql/regress/core/TEST038
modified: docs/messages_guide/src/asciidoc/_chapters/binder_msgs.adoc
----
> Improve on split_part builtin-function
> --------------------------------------
>
> Key: TRAFODION-3136
> URL: https://issues.apache.org/jira/browse/TRAFODION-3136
> Project: Apache Trafodion
> Issue Type: Improvement
> Reporter: zhang.lei
> Assignee: zhang.lei
> Priority: Major
>
> {color:#FF0000}use like below descripyon:{color}
>
> >>select split_part('sa:sbl:sc', ':', 1) from t038sf;
> (EXPR)
> ---------
> sa
> --- 1 row(s) selected.
> >>select split_part('sa:sbl:sc', ':', 2) from t038sf;
> (EXPR)
> ---------
> sbl
> --- 1 row(s) selected.
> >>select split_part('sa:sbl:sc', ':', 3) from t038sf;
> (EXPR)
> ---------
> sc
> --- 1 row(s) selected.
> >>
> >>-- **ERROR**
> >>select split_part('sa:sbl:sc', ':', 0) from t038sf;
> *** ERROR[4497] The Third operand of split_part must be greater than 0
> --- 0 row(s) selected.
> >>–**EMPTY RESULT**
> >>select split_part('sa:sbl:sc', ':', 4) from t038sf;
> (EXPR)
> ---------
>
> --- 1 row(s) selected.
>
> >> create table T038sf(a int, b char(10), c varchar(30));
> >>insert into T038sf values(110, 'a/b/c', 'sa/dsd/s');
> --- 1 row(s) inserted.
> >>insert into T038sf values(111, 'sasd', 'dsa:/~sd');
> --- 1 row(s) inserted.
> >>insert into T038sf values(112, '#$%$#@', 'dsasggggsad');
> --- 1 row(s) inserted.
> >>insert into T038sf values(114, 'a', '这是^中文:测试');
> --- 1 row(s) inserted.
> >>select split_part(c, '/', 2) from t038sf;
> (EXPR)
> ------------------------------
> dsd
> ~sd
>
>
> --- 4 row(s) selected.
> >>select split_part(c, 'ggg', 2) from t038sf;
> (EXPR)
> ------------------------------
>
> gsad
> --- 4 row(s) selected.
> >>select split_part(c, 'sd', 1) from t038sf;
> (EXPR)
> ------------------------------
> sa/d
> dsa:/~
>
>
> --- 4 row(s) selected.
>
> >>select split_part(c, ':', 1) from t038sf;
> (EXPR)
> ------------------------------
>
> 这是^中文
> --- 4 row(s) selected.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)