Skip to main content
Question

v_txtindex.StringTokenizerDelim not working well since upgrade to 10.1

  • March 15, 2021
  • 2 replies
  • 6 views

Igor88

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!

2 replies

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • March 15, 2021

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_Cary
Forum|alt.badge.img
  • Participating Frequently
  • April 13, 2021

@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;