【问题标题】:What is POSITION(field) in Google BIgQuery?Google BIgQuery 中的 POSITION(field) 是什么?
【发布时间】:2012-07-06 10:33:15
【问题描述】:

我正在使用 Google BigQuery,但对它提供的 POSITION(field) 函数有疑问。

我认为 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
....
...
..
.

在这种情况下,POSITION(url) 是什么意思? 谷歌 BigQuery 示例提供的任何嵌套字段也可以用来测试吗?

谢谢你

【问题讨论】:

    标签: position google-bigquery


    【解决方案1】:

    据我所知,对于非嵌套字段,POSITION 将返回数据分片中的行偏移量——也就是说,如果基础数据被分成 100 块,并且您的结果每块有 10 行,您将有 1-10 的位置值重复 100 次。这不太可能特别有用。可以说,这应该返回全局位置(即在上述情况下,它将返回 1-1000),如果您同意,请告诉我,我会看看是否可以更改。

    【讨论】:

      猜你喜欢
      • 2019-06-29
      • 1970-01-01
      • 2015-11-08
      • 2019-08-07
      • 1970-01-01
      • 1970-01-01
      • 2016-12-13
      • 2011-11-30
      • 1970-01-01
      相关资源
      最近更新 更多