Skip to content

Commit

Permalink
Nested filtering
Browse files Browse the repository at this point in the history
add script to run arbitrary SQL

remove unused env vars

use the linux binary directly

remove checking out ndc-spec

install libssl3

generate the correct nested fields filtering predicate

generate the WHERE predicate for nested fields

get the recursion correct [WIP]

get the binary comparison operator for a Column

pass around the rootContainerAlias

rename visitNestedField1 to visitNestedField

refactor visitNestedField

change the file structure

fix the syntax of the query

remove redundant function

minor no-op refactors

fix tests

update README according to the latest template (#37)

Fix NDC tests (#40)

* fix NDC tests

* checkout v0.1.5

* update typescript ndc version

* npm audit fix

add sql generation tests

Add script to run ndc tests (#41)

* add a npm script to run ndc-tests

* generate configuration before starting the server

* test out github workflow

* try with ubuntu-latest

* add debug statement

* debug

* remove the loging into GHCR

Seed data into test container (#42)

* fix test

* setup data only when --setup-data option is provided

* set up the azure cosmos emulator

* fix syntax errors

* use the emulator values

* setup emulator data

* fix issues

* use await

* disable tls

* fix typo

* fix syntax

* add indexing bit while creating the container

* fail the process when encountering any error

figure out where the bug is

one more attempt at debugging

add debug statement

revert back the cli changes

fix the imports

fix import 1

add nested array object field filtering test case

modify the failing tests according to the new data

add nested filtering tests
  • Loading branch information
codingkarthik committed Sep 12, 2024
1 parent 482b5b7 commit 2605c7e
Show file tree
Hide file tree
Showing 18 changed files with 9,150 additions and 1,086 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"collection": "TestNobelLaureates",
"query": {
"fields": {
"laureates": {
"type": "column",
"column": "laureates",
"fields": {
"type": "array",
"fields": {
"type": "object",
"fields": {
"firstName": {
"type": "column",
"column": "firstname"
},
"id": {
"type": "column",
"column": "id"
},
"share": {
"type": "column",
"column": "share"
},
"awards": {
"type": "column",
"column": "awards",
"fields": {
"type": "array",
"fields": {
"type": "object",
"fields": {
"name": {
"type": "column",
"column": "award_name"
},
"year": {
"type": "column",
"column": "year"
}
}
}
}
}
}
}
}
},
"overallMotivation": {
"type": "column",
"column": "overallMotivation",
"fields": null
},
"prize_id": {
"type": "column",
"column": "prize_id",
"fields": null
},
"year": {
"type": "column",
"column": "year",
"fields": null
}
},
"limit": 10,
"predicate": {
"type": "binary_comparison_operator",
"column": {
"type": "column",
"name": "laureates",
"field_path": [
"share"
],
"path": []
},
"operator": "gt",
"value": {
"type": "scalar",
"value": "1"
}
},
"order_by": {
"elements": [
{
"order_direction": "asc",
"target": {
"type": "column",
"name": "year",
"path": []
}
}
]
}
},
"arguments": {},
"collection_relationships": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
[
{
"rows": [
{
"laureates": [
{
"firstName": "Leonid",
"id": "820",
"share": "3"
},
{
"firstName": "Eric S.",
"id": "821",
"share": "3"
},
{
"firstName": "Roger B.",
"id": "822",
"share": "3"
}
],
"overallMotivation": null,
"prize_id": 98,
"year": 2007
},
{
"laureates": [
{
"firstName": "Intergovernmental Panel on Climate Change",
"id": "818",
"share": "2"
},
{
"firstName": "Al",
"id": "819",
"share": "2"
}
],
"overallMotivation": null,
"prize_id": 100,
"year": 2007
},
{
"laureates": [
{
"firstName": "Osamu",
"id": "829",
"share": "3"
},
{
"firstName": "Martin",
"id": "830",
"share": "3"
},
{
"firstName": "Roger Y.",
"id": "831",
"share": "3"
}
],
"overallMotivation": null,
"prize_id": 91,
"year": 2008
},
{
"laureates": [
{
"firstName": "Yoichiro",
"id": "826",
"share": "2"
},
{
"firstName": "Makoto",
"id": "827",
"share": "4"
},
{
"firstName": "Toshihide",
"id": "828",
"share": "4"
}
],
"overallMotivation": null,
"prize_id": 95,
"year": 2008
},
{
"laureates": [
{
"firstName": "Harald",
"id": "823",
"share": "2"
},
{
"firstName": "Françoise",
"id": "824",
"share": "4"
},
{
"firstName": "Luc",
"id": "825",
"share": "4"
}
],
"overallMotivation": null,
"prize_id": 96,
"year": 2008
},
{
"laureates": [
{
"firstName": "Venkatraman",
"id": "841",
"share": "3"
},
{
"firstName": "Thomas A.",
"id": "842",
"share": "3"
},
{
"firstName": "Ada E.",
"id": "843",
"share": "3"
}
],
"overallMotivation": null,
"prize_id": 85,
"year": 2009
},
{
"laureates": [
{
"firstName": "Elinor",
"id": "846",
"share": "2"
},
{
"firstName": "Oliver E.",
"id": "847",
"share": "2"
}
],
"overallMotivation": null,
"prize_id": 86,
"year": 2009
},
{
"laureates": [
{
"firstName": "Charles K.",
"id": "838",
"share": "2"
},
{
"firstName": "Willard S.",
"id": "839",
"share": "4"
},
{
"firstName": "George E.",
"id": "840",
"share": "4"
}
],
"overallMotivation": null,
"prize_id": 89,
"year": 2009
},
{
"laureates": [
{
"firstName": "Elizabeth H.",
"id": "835",
"share": "3"
},
{
"firstName": "Carol W.",
"id": "836",
"share": "3"
},
{
"firstName": "Jack W.",
"id": "837",
"share": "3"
}
],
"overallMotivation": null,
"prize_id": 90,
"year": 2009
},
{
"laureates": [
{
"firstName": "Richard F.",
"id": "851",
"share": "3"
},
{
"firstName": "Ei-ichi",
"id": "852",
"share": "3"
},
{
"firstName": "Akira",
"id": "853",
"share": "3"
}
],
"overallMotivation": null,
"prize_id": 79,
"year": 2010
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"collection": "TestNobelLaureates",
"query": {
"fields": {
"laureates": {
"type": "column",
"column": "laureates",
"fields": {
"type": "array",
"fields": {
"type": "object",
"fields": {
"firstName": {
"type": "column",
"column": "firstname"
},
"id": {
"type": "column",
"column": "id"
},
"share": {
"type": "column",
"column": "share"
}
}
}
}
},
"overallMotivation": {
"type": "column",
"column": "overallMotivation",
"fields": null
},
"prize_id": {
"type": "column",
"column": "prize_id",
"fields": null
},
"year": {
"type": "column",
"column": "year",
"fields": null
}
},
"limit": 10,
"predicate": {
"type": "binary_comparison_operator",
"column": {
"type": "column",
"name": "laureates",
"field_path": ["share"],
"path": []
},
"operator": "gt",
"value": {
"type": "scalar",
"value": "1"
}
},
"order_by": {
"elements": [
{
"order_direction": "asc",
"target": {
"type": "column",
"name": "year",
"path": []
}
}
]
}
},
"arguments": {},
"collection_relationships": {}
}
Loading

0 comments on commit 2605c7e

Please sign in to comment.