Skip to content

gaurav-2-0-0-2/DuckMart

Repository files navigation

Instructions about the project

For running the project locally follow these steps:

  1. Install NodeJs
  2. Open the terminal and Clone this repository by running:
    git clone git@github.com:HousewareHQ/houseware---data-engineering-octernship-gaurav-2-0-0-2.git
  3. After cloning go to the project folder and run:
    npm install
  4. Now for running the project locally run:
    node server.js

For testing the queries:

  1. Install duckdb CLI
  2. Unzip the folder in the same directory as of the project.
  3. In order to run the queries to show the result in terminal run:
    ./duckdb --init init.sql my-db.duckdb < queries/<query_name>.sql

For testing the API endpoint

  1. Download Postman
  2. Open postman and change the following:
    i. HTTP request to POST request.
    ii. Enter http://localhost:3000/segment in the input box.
    iii. Select Body --> raw and set JSON data.
    iv. Put the JSON file's data (from the project) in the POST request body.
    v. Make sure that your project is running locally.
    vi. Click send button to post your JSON data and you can change the JSON data according to your need.
    The specs for JSON file are:
{
"criteria":{
"field":  "user_id",
"table":  "user_table",
"condition":{
"parameter":  "age",
"value":  "30",
"operator":  "between",
"conjunction":  "and",
"min":  "25",
"max":  "34"
},
"join":{
"type":  "join",
"user_alias":  "a",
"event_alias":  "e",
"joining_table":  "event_table",
"joining_key":  "user_id",
"conjunction":  "and",
"parameter1":  "location",
"value1":"'California'",
"parameter2":  "event_name",
"value2":  "'LOGIN'"
  }
 }
}

You will be able to see the results in the console or terminal.
This is just an example you can modify the JSON as you need.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published