Skip to content

Commit

Permalink
Nested field filtering (#47)
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

* add sql generation tests

* 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

* Nested filtering

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

* don't run tests on the azure cosmos emulator

* comment out the setting up of azure cosmos emulator

* use the correct env values

* rever the changes in script folder

* remove the tests

* minor refactor

* remove more tests

* remove even more tests

* fix deep nested filtering bug

* refactor visitNestedField

* fix bug

* minor no-op refactor

* add comment on getScalarType

* minor refactor

* incorporate review comments

* follow TS convention
  • Loading branch information
codingkarthik authored Sep 23, 2024
1 parent a803b83 commit 9697e04
Show file tree
Hide file tree
Showing 21 changed files with 9,008 additions and 1,858 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ jobs:
with:
path: cosmos

- name: Set up Docker
uses: docker-practice/actions-setup-docker@master

- name: Pull and run Azure Cosmos DB Emulator
run: |
docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
docker run -d --name=cosmos-emulator -p 8081:8081 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 \
-e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 \
-e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false \
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
- name: Wait for Cosmos DB Emulator to be ready
run: |
timeout 300 bash -c 'until curl -ks https://localhost:8081/_explorer/emulator.pem > /dev/null; do sleep 5; done'
echo "Cosmos DB Emulator is ready"
- name: Download Cosmos DB Emulator certificate
run: |
curl -k https://localhost:8081/_explorer/emulator.pem > emulatorcert.crt
sudo cp emulatorcert.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
# - name: Set up Docker
# uses: docker-practice/actions-setup-docker@master

# - name: Pull and run Azure Cosmos DB Emulator
# run: |
# docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
# docker run -d --name=cosmos-emulator -p 8081:8081 -p 10251:10251 -p 10252:10252 -p 10253:10253 -p 10254:10254 \
# -e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 \
# -e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=false \
# mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator

# - name: Wait for Cosmos DB Emulator to be ready
# run: |
# timeout 300 bash -c 'until curl -ks https://localhost:8081/_explorer/emulator.pem > /dev/null; do sleep 5; done'
# echo "Cosmos DB Emulator is ready"

# - name: Download Cosmos DB Emulator certificate
# run: |
# curl -k https://localhost:8081/_explorer/emulator.pem > emulatorcert.crt
# sudo cp emulatorcert.crt /usr/local/share/ca-certificates/
# sudo update-ca-certificates

- name: Build connector
run: |
Expand All @@ -55,9 +55,9 @@ jobs:
- name: Run tests
env:
AZURE_COSMOS_KEY: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
AZURE_COSMOS_ENDPOINT: https://localhost:8081
AZURE_COSMOS_DB_NAME: TestNobelLaureates
AZURE_COSMOS_KEY: ${{ secrets.AZURE_COSMOS_KEY }}
AZURE_COSMOS_ENDPOINT: ${{ secrets.AZURE_COSMOS_ENDPOINT }}
AZURE_COSMOS_DB_NAME: ${{ secrets.AZURE_COSMOS_DB_NAME }}
run: |
cd cosmos
npm run ndc-test -- --setup-emulator-data
npm run ndc-test
Loading

0 comments on commit 9697e04

Please sign in to comment.