Strange array_to_table / unnest result

Поиск
Список
Период
Сортировка
От Johann Spies
Тема Strange array_to_table / unnest result
Дата
Msg-id CAGZ55DTPFhs29eOrQqs4eyPzw4FzHS3YtkKoy76-bmozF1Ortg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Strange array_to_table / unnest result  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
When I unnest (regexp_split_to_array) or regexep_split_to_table

I get one value but the length of the array without the unnest is 193.

Why would that be?

wos=# select array_length(regexp_split_to_array(tsv::text, E'\\\s+'),1), unnest(regexp_split_to_array(tsv::text, E'\\\s+'))
wos-# from wos_2016_2.abstract limit 1
wos-# ;
 array_length | unnest 
--------------+---------
          193 | '1':539
(1 row)


select unnest(regexp_split_to_array(tsv::text, E'\\\s+'))
from wos_2016_2.abstract limit 1
;
 unnest 
---------
 '1':539
(1 row)

wos=# select regexp_split_to_table(tsv::text, E'\\\s+')
from wos_2016_2.abstract limit 1
;
 regexp_split_to_table
-----------------------
 '1':539
(1 row)


The array looks like this:

{'1':539,'10':323,'100':477,'12.5':465,'2':552,"'25':337,399","'2d':47,365",'3':563,'3136':387,"'3d':49,68,75,218,282,304,318,344,381,549,603,612",'4':580,'50':470,'75':405,'acquir':527,"'acquisit':61,170",'actual':52,'adapt':297,"'algorithm':206,220,261,321,366,384,582,615",'almost':150,"'along':244,481","'also':358,374,513,597","'amplitud':353,425",'analyz':84,'apex':495,'apex-shift':494,"'appli':67,257,514","'applic':457,600","'approach':78,107,118,347,419,498,595",'approxim':270,'area':446,"'assumpt':229,502,588","'base':30,79,119,226,263,499",'basic':286,'better':126,'calcul':194,'cannot':146,'categori':92,'characterist':293,'china':448,'circumst':438,'classifi':86,'close':433,'common':412,'common-offset':411,'compar':215,'comparison':341,"'complex':43,103,311,548",'concept':192,'conclus':538,"'contribut':190,200,254","'correct':260,356,428,517,576",'cost':224,'cours':623,"'crosslin':186,198,232",'crucial':301,'current':168,'curv':236,"'data':20,27,60,72,101,115,139,154,157,173,209,313,437,443,487,532,551,556,591,631","'data-driven':26,114",'decreas':222,'demand':578,"'demultipl':73,214",'dens':175,'design':375,'difficult':65,'dimension':2,"'direct':180,187,246,483,559",'disadvantag':144,'distanc':235,'doesn':108,'domain':492,"'driven':28,116",'dynam':292,'effect':459,'elimin':7,"'equat':34,122",'event':507,'explor':23,'extent':601,"'field':71,153,442","'filter':93,106",'finish':248,'first':250,'follow':537,'forward':566,'four':370,'four-lay':369,"'full':137,281,436,590","'gather':191,255",'geolog':104,'geometri':171,'great':225,"'high':56,629,635",'horizont':368,'howev':112,"'hyperbol':238,504",'i.e':241,"'imag':511,637","'import':13,143",'improv':617,'inform':133,"'inlin':179,245,482,558","'integr':243,486","'interv':331,334,396,403,463,468,475",'introduc':189,"'invers':82,205,380,454,521,570,594",'investig':530,'kinemat':290,'layer':371,"'line':402,474","'m':338,400,406,466,471,478","'marin':22,152,169",'mean':202,'media':372,'meet':148,"'method':89,96,276,284,455,542","'model':312,328,550","'multipl':6,41,76,87,125,163,199,272,294,305,319,345,351,382,423,525,604,613",'necessari':160,'need':562,'offset':413,'one':10,"'parabol':240,506",'partial':485,"'phase':259,269,355,516,575","'predict':271,295,320,346,349,421,524",'preprocess':625,'principl':266,"'process':17,74,252","'propos':275,317,418,452,541,611",'provid':627,'qualiti':630,"'radon':491,497,510,567,571",'ratio':620,'real':554,"'reconstruct':158,210,560","'record':326,389","'relat':5,40",'reli':585,"'requir':57,130,140",'resolut':636,'respect':97,"'result':278,340,361,414,607",'s/n':619,"'sampl':176,197","'seismic':19,59,100,555",'sens':50,'shift':496,"'shot':325,330,388,395,467","'show':342,415,449,608",'simpl':546,'simul':310,'singl':408,'solut':522,"'spars':81,183,195,196,204,379,453,520,593","'srme':8,29,69,95,117,135,166,219,283,308",'stack':508,'stationari':268,"'step':251,302",'storag':223,"'structur':44,105",'subsequ':634,"'subtract':298,360",'suitabl':544,'summat':480,'superior':363,"'suppress':36,77,88,124,164,306,383,605,614","'surfac':4,39","'surface-rel':3,38","'test':315,377,440,533","'theoret':24,529","'therefor':155,207",'thousand':324,'three':1,'time':234,'time-dist':233,'topic':14,'total':391,"'trace':333,393,409,462","'tradit':162,217","'transform':489,568,572",'traveltim':427,"'two':91,300",'unnecessari':212,"'use':165,307,493,574,592",'usual':64,'veloc':132,"'wave':33,121",'wave-equ':32,'wavefield':138,'well':111,'widen':598,'work':110}


Regards
Johann

--
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

В списке pgsql-general по дате отправления:

Предыдущее
От: Devrim Gündüz
Дата:
Сообщение: Re: postgresql "init script" for postgres 9.2.15
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Strange array_to_table / unnest result