Skip to content

Commit

Permalink
Merge pull request #417 from mabel-dev/FIX/#399
Browse files Browse the repository at this point in the history
FIX/#399
  • Loading branch information
joocer committed Aug 26, 2022
2 parents bb42412 + 944bee8 commit f72c078
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/Release Notes/Change Log.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [[#334](https://github.com/mabel-dev/opteryx/issues/334)] All lists should be cast to lists of strings. ([@joocer](https://github.com/joocer))
- [[#382](https://github.com/mabel-dev/opteryx/issues/382)] `INNER JOIN` on `UNNEST` relation. ([@joocer](https://github.com/joocer))
- [[#320](https://github.com/mabel-dev/opteryx/issues/320)] Can't execute functions on results of `GROUP BY`. ([@joocer](https://github.com/joocer))
- [[#399](https://github.com/mabel-dev/opteryx/issues/399)] Strings in double quotes aren't parsed. ([@joocer](https://github.com/joocer))

## [0.2.0] - 2022-07-31

Expand Down
5 changes: 3 additions & 2 deletions opteryx/engine/planner/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ def _build_literal_node(self, value, alias: list = []):
"""
if value is None or value == "Null":
return ExpressionTreeNode(NodeType.LITERAL_NONE)
if "SingleQuotedString" in value:
string_quoting = list(value.keys())[0]
if string_quoting in ("SingleQuotedString", "DoubleQuotedString"):
# quoted strings are either VARCHAR or TIMESTAMP
str_value = value["SingleQuotedString"]
str_value = value[string_quoting]
dte_value = dates.parse_iso(str_value)
if dte_value:
return ExpressionTreeNode(
Expand Down
2 changes: 2 additions & 0 deletions tests/sql_battery/test_battery_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@
("EXPLAIN SELECT * FROM $planets AS a INNER JOIN (SELECT id FROM $planets) AS b USING (id)", 3, 3),
# ALIAS issues #408
("SELECT $planets.* FROM $planets INNER JOIN (SELECT id FROM $planets) AS b USING (id)", 9, 21),
# DOUBLE QUOTED STRING #399
("SELECT birth_place['town'] FROM $astronauts WHERE birth_place['town'] = \"Rome\"", 1, 1),
]
# fmt:on

Expand Down

0 comments on commit f72c078

Please sign in to comment.