【问题标题】:cassandra CQL not use UDF in wherecassandra CQL 在 where 不使用 UDF
【发布时间】:2018-07-09 17:43:37
【问题描述】:

为什么Where中不能使用UDF?

select * from user_by_location
where distanceOf(latlng.lat,latlng.lng,42.15444,34.58511) > 1;

SyntaxException:第 1:47 行在输入 '(' 处没有可行的替代方案 (select * from user_by_location where [distanceOf](...)

【问题讨论】:

  • 你的UDF定义、表结构和cassandra版本是什么?

标签: user-defined-functions cql


【解决方案1】:

您不能在 where 子句中使用 UDF(过滤查询)。

如果您想关注它,允许这样做的功能请求是 here。总而言之,它需要重新排列代码的一些主要部分,并可能导致性能下降和/或数据陈旧。

(顺便说一句,您似乎正在尝试使用地理空间数据,因此您可能会发现了解如何使用 Spark 或 DSE 处理它会有所帮助。)

【讨论】:

    猜你喜欢
    • 2018-09-19
    • 2017-01-01
    • 1970-01-01
    • 2015-05-05
    • 2013-04-23
    • 2013-03-04
    • 2016-06-12
    • 2017-02-23
    • 2014-11-15
    相关资源
    最近更新 更多