在 Amazon SimpleDB 上执行排序/排序的结果不均匀

发布于 2024-08-21 04:25:30 字数 684 浏览 6 评论 0原文

我尝试从 Amazon SimpleDB 请求按数字排序的记录列表时,得到的结果非常参差不齐。

我用零填充我的数字以按字典顺序选择它们,但仍然没有运气。这两个查询给出相同的结果,例如:

select * from cbcallers where calls_completed is not null order by calls_completed desc

select * from cbcallers where calls_completed is not null order by calls_completed asc

但是,我使用亚马逊的查询语言得到了正确的结果:

['calls_completed'starts-with ''] sort 'calls_completed' desc

上周,我从同一查询中得到不同(无序)结果数据集。有人知道怎么回事吗?我的查询被劫持了吗?

数据集如下所示:

Sdb-Item-Name, calls_completed, name, icon
8uda23sd7, 0000002, john smith, /myimgicon.jpg
8uda5asd3, 0000015, john smarts, /myimgicon2.jpg
8udassad8, 0000550, john smoogie, /myimgicon3.jpg

I've been getting really uneven results trying to request a numerically sorted list of records from Amazon SimpleDB.

I am zero padding my numbers to get them selected lexigraphically, but still no luck. These two queries are giving the same result, for example:

select * from cbcallers where calls_completed is not null order by calls_completed desc

select * from cbcallers where calls_completed is not null order by calls_completed asc

However, I am getting the correct results using Amazon's query language:

['calls_completed'starts-with ''] sort 'calls_completed' desc

And last week, I was getting different (unordered) results from this query on the same dataset. Anyone have any idea what's up? Is my query jacked?

The dataset looks like this:

Sdb-Item-Name, calls_completed, name, icon
8uda23sd7, 0000002, john smith, /myimgicon.jpg
8uda5asd3, 0000015, john smarts, /myimgicon2.jpg
8udassad8, 0000550, john smoogie, /myimgicon3.jpg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

祁梦 2024-08-28 04:25:30

您的查询看起来完全正确。我加载了您的数据并逐字使用您的查询,并得到了您所期望的结果。

升序:

select * from cbcallers where calls_completed is not null order by calls_completed asc
[
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550]

降序:

select * from cbcallers where calls_completed is not null order by calls_completed desc
[
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002]

也许是您的 SimpleDB 客户端的问题,您使用的是哪一个,您知道它是否使用最新的 SimpleDB API 版本(“2009-04-15”)?

Your query looks completely correct. I loaded your data and used your queries verbatim and got just what you would expect.

Ascending:

select * from cbcallers where calls_completed is not null order by calls_completed asc
[
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550]

Descending:

select * from cbcallers where calls_completed is not null order by calls_completed desc
[
Item  8udassad8
  icon: myimgicon3.jpg
  name: john smoogie
  calls_completed: 0000550, 
Item  8uda5asd3
  icon: myimgicon2.jpg
  name: john smarts
  calls_completed: 0000015, 
Item  8uda23sd7
  icon: myimgicon.jpg
  name: john smith
  calls_completed: 0000002]

Maybe it is an issue with your SimpleDB client, which one are you using, do you know if it is using the latest SimpleDB API version ("2009-04-15")?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文