Adds a SqlGlot implementation of the OSI SQL dialect#222
Conversation
7d34e38 to
2f2f84f
Compare
| from enum import Enum | ||
| from typing import Any, Optional, Union | ||
| from enum import StrEnum | ||
| from typing import Any |
There was a problem hiding this comment.
Why the changes to this file models.py ? They look unrelated to the SQL dialect implementation.
There was a problem hiding this comment.
Yeah. It is making the type system better, but not strictly needed in this pr. I can remove it.
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
There was a problem hiding this comment.
How about we rename this to python/src/ossie-model ? Right now it reads like /ossie/src/ossie which is confusing.
There was a problem hiding this comment.
No, we should stick with more cannonical Python pathing. Although, the naming will match what we come up with in Ossie Project Development Guidelines
Currently, that proposes core/python/ossie and core/python/ossie-sql
However, I was going to wait until that got settled before doing the change.
| build-backend = "hatchling.build" | ||
|
|
||
| [project] | ||
| name = "apache-ossie" |
There was a problem hiding this comment.
I don't think we want to export a package called ossie-model. When a user installs ossie, I think it should be apache-ossie not ossie-model.
So, i think we probably want to keep this.
| Implements the grammar defined in ``core-spec/expression_language.md`` | ||
| ("Ossie_SQL_2026"). Registers with SQLGlot as ``"ossie"``, so | ||
| ``sqlglot.parse_one(sql, read="ossie")`` parses the spec's SQL subset and | ||
| ``expression.sql(dialect="ossie")`` renders it back. |
There was a problem hiding this comment.
The dialect name in the json spec and in the consumers should then just be "ossie" ?
There was a problem hiding this comment.
I was going to update the json spec, etc. as a different PR. I'm trying to keep this one to just the SqlGlot dialect.
khush-bhatia
left a comment
There was a problem hiding this comment.
Looks good , just some comments about some unrelated changes.
Thank for this, this is a great direction to standardize on the expression language.
2f2f84f to
c09d3b0
Compare
Summary
Implements the expression language from the Ossie spec. Also, found a spec oversight, that caused an incompatibility with ANSII around NOT operator precedence. Having ANSII compliance was a clear requirement of the expression langauge group.
Updates the spec and implements the language as a SqlGlot dialect.
Related Issues
Checklist
Specification
core-spec/and follow the existing structureTests
pytest/ CI green)Compliance