v_txtindex.StringTokenizerDelim not working well since upgrade to 10.1

Igor88Igor88 - Select Field -

Hi,
I used this function : v_txtindex.StringTokenizerDelim
and the output was : "words", "input" columns (two columns)
now, when I use it I have only one output column "words"
how can I get the second column also ?
Thanks!

Tagged:

Answers

  • SruthiASruthiA Administrator

    It is still showing 2 columns in 10.1. please find the sample example below.

    dbadmin=> select version();

    version

    Vertica Analytic Database v10.1.0-1
    (1 row)

    dbadmin=>

    dbadmin=> CREATE TABLE string_table (word VARCHAR(100), delim VARCHAR);
    CREATE TABLE
    dbadmin=> COPY string_table FROM STDIN DELIMITER ',';
    Enter data to be copied followed by a newline.
    End with a backslash and a period on a line by itself.

    SingleWord,dd
    Break On Spaces,' '
    Break:On:Colons,:
    .

    dbadmin=> SELECT * FROM string_table;
    word | delim
    -----------------+-------
    SingleWord | dd
    Break On Spaces | ' '
    Break:On:Colons | :
    (3 rows)

    dbadmin=> SELECT v_txtindex.StringTokenizerDelim(word,delim) OVER (PARTITION BY word), word as input FROM string_table;
    words | input
    -----------------+-----------------
    SingleWor | SingleWord
    Break On Spaces | Break On Spaces
    Break | Break:On:Colons
    On | Break:On:Colons
    Colons | Break:On:Colons
    (5 rows)

  • Ariel_CaryAriel_Cary Vertica Employee Employee

    @SruthiA in your example query, v_txtindex.StringTokenizerDelim returns only 1 column. The query adds a second output column word as input.

    SELECT v_txtindex.StringTokenizerDelim(word,delim) OVER (PARTITION BY word), word as input FROM string_table;
    

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file