2012-07-06 75 views
1

我使用Google BigQuery,並且提供了它提供的POSITION(field)函數的問題。什麼是Google BIgQuery中的POSITION(字段)?

我以爲POSITION函數在嵌套字段中返回查詢中值的位置。

但我很驚訝,它也適用於非嵌套字段。

例如。

SELECT url, POSITION(url) FROM [publicdata:samples.github_timeline] WHERE url="https://github.com/oscardelben/sheet"; 

和輸出

Row url         f0_ 
1 https://github.com/oscardelben/sheet 1 
2 https://github.com/oscardelben/sheet 2 
3 https://github.com/oscardelben/sheet 3 
4 https://github.com/oscardelben/sheet 4 
5 https://github.com/oscardelben/sheet 5 
6 https://github.com/oscardelben/sheet 6 
7 https://github.com/oscardelben/sheet 1 
8 https://github.com/oscardelben/sheet 2 
9 https://github.com/oscardelben/sheet 3 
.... 
... 
.. 
. 

在這種情況下,是什麼位置(URL)是什麼意思? 也有我可以測試的Google BigQuery示例提供的任何嵌套字段嗎?

我很欣賞喲

回答

0

從我可以告訴,對於一個非嵌套場,位置將恢復該行的數據碎片偏移 - 也就是說,如果基礎數據被分成100片,你的結果每行有10行,你可以將位置值1-10重複100次。這不太可能是特別有用的。可以說,這應該返回全球的位置(也就是說,它會在上述情況下返回1-1000),如果您同意,請告訴我,我會看看它是否可以更改。

相關問題