You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Volodymyr Vysotskyi (JIRA)" <ji...@apache.org> on 2018/06/07 17:09:00 UTC
[jira] [Comment Edited] (CALCITE-194) Array items in MongoDB
adapter
[ https://issues.apache.org/jira/browse/CALCITE-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504926#comment-16504926 ]
Volodymyr Vysotskyi edited comment on CALCITE-194 at 6/7/18 5:08 PM:
---------------------------------------------------------------------
- Please replace usage of {{String.format(Locale.ENGLISH...)}} by {{String.format(Locale.ROOT ...)}}, the same approach was used in other places in the project.
- Please remove ignoring unit test, I checked and it is passed on my PC for current master.
- two {{if}} conditions in {{MongoRules}} may be united:
{code:java}
if (op1 instanceof RexLiteral
&& op1.getType().getSqlTypeName() == SqlTypeName.INTEGER) {
if (op0 instanceof RexCall) {
Integer index = ((RexLiteral) op1).getValueAs(Integer.class);
return String.format(Locale.ENGLISH, ARRAY_ELEM_AT, strings.get(0), index);
}
return strings.get(0) + "[" + strings.get(1) + "]";
}
{code}
was (Author: vvysotskyi):
- Please replace usage of {{String.format(Locale.ENGLISH...)}} by {{String.format(Locale.{{String.format(Locale.ENGLISH...)}} by ...)}}, the same approach was used in other places in the project.
- Please remove ignoring unit test, I checked and it is passed on my PC for current master.
- two {{if}} conditions in {{MongoRules}} may be united:
{code:java}
if (op1 instanceof RexLiteral
&& op1.getType().getSqlTypeName() == SqlTypeName.INTEGER) {
if (op0 instanceof RexCall) {
Integer index = ((RexLiteral) op1).getValueAs(Integer.class);
return String.format(Locale.ENGLISH, ARRAY_ELEM_AT, strings.get(0), index);
}
return strings.get(0) + "[" + strings.get(1) + "]";
}
{code}
> Array items in MongoDB adapter
> ------------------------------
>
> Key: CALCITE-194
> URL: https://issues.apache.org/jira/browse/CALCITE-194
> Project: Calcite
> Issue Type: Bug
> Reporter: GitHub Import
> Assignee: Igor Kryvenko
> Priority: Major
> Labels: github-import
> Fix For: 1.17.0
>
>
> When MongoDB issue <a href="https://jira.mongodb.org/browse/SERVER-4589">SERVER-4589</a>, "aggregation: need an array indexing operator" is fixed, we will be able to implement
> ```sql
> SELECT loc[0] AS longitude, loc[1] AS latitude FROM zips
> ```
> in the MongoDB adapter. Meantime, look for `Bug.OPTIQnnn_FIXED` in the code.
> ---------------- Imported from GitHub ----------------
> Url: https://github.com/julianhyde/optiq/issues/194
> Created by: [julianhyde|https://github.com/julianhyde]
> Labels: bug,
> Created at: Wed Mar 19 00:03:01 CET 2014
> State: open
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)