Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
codingkarthik committed Dec 18, 2024
1 parent 8e204ba commit f9c9c05
Show file tree
Hide file tree
Showing 100 changed files with 1,953 additions and 1,508 deletions.
78 changes: 78 additions & 0 deletions relational/find_missing_responses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

# Set error handling
set -euo pipefail

# Function to print error messages
error() {
echo "ERROR: $1" >&2
exit 1
}

# Function to print status messages
info() {
echo "INFO: $1"
}

# Function to print folder paths in a consistent format
print_folder() {
local dir="$1"
local request_file="$dir/request.json"
local request_size=""

# Get the size of request.json if it exists
if [ -f "$request_file" ]; then
request_size=$(wc -l < "$request_file")
fi

printf "%-60s | request.json: %3s lines\n" "$dir" "$request_size"
}

echo "==========================================================================="
echo " MISSING RESPONSE.JSON FILES REPORT"
echo "==========================================================================="
echo
echo "Folders containing request.json but missing response.json:"
echo "-----------------------------------------------------------"

# Initialize counter for missing response files
missing_count=0
missing_folders=()

# Find all directories containing request.json
while IFS= read -r -d '' dir; do
dir=$(dirname "$dir")
if [ ! -f "$dir/response.json" ]; then
missing_folders+=("$dir")
((missing_count++))
fi
done < <(find . -name "request.json" -print0)

# Sort the missing folders for consistent output
IFS=$'\n' sorted_folders=($(sort <<<"${missing_folders[*]}"))
unset IFS

# Print the sorted folders
for dir in "${sorted_folders[@]}"; do
print_folder "$dir"
done

echo
echo "==========================================================================="
echo "SUMMARY:"
echo " - Total folders scanned: $(find . -name "request.json" | wc -l)"
echo " - Folders missing response.json: $missing_count"
echo "==========================================================================="

# Export to file if missing folders were found
if [ $missing_count -gt 0 ]; then
report_file="missing_responses_report.txt"
{
echo "Missing response.json files report"
echo "Generated on: $(date)"
echo "----------------------------------------"
printf "%s\n" "${sorted_folders[@]}"
} > "$report_file"
echo
info "Report saved to $report_file"
fi
12 changes: 12 additions & 0 deletions relational/query/aggregate_count_albums/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"aggregates": {
"how_many_albums": 347,
"how_many_artist_ids": 347,
"how_many_distinct_artist_ids": 204,
"min_artist_id": 1,
"max_artist_id": 275,
"avg_artist_id": 121.94236311239192
}
}
]
44 changes: 44 additions & 0 deletions relational/query/aggregate_count_albums_plus_field/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
"aggregates": {
"how_many_albums": 10,
"how_many_artist_ids": 10,
"how_many_distinct_artist_ids": 8,
"min_artist_id": 8,
"max_artist_id": 15,
"avg_artist_id": 11.5
},
"rows": [
{
"Title": "Out Of Exile"
},
{
"Title": "BackBeat Soundtrack"
},
{
"Title": "The Best Of Billy Cobham"
},
{
"Title": "Alcohol Fueled Brewtality Live! [Disc 1]"
},
{
"Title": "Alcohol Fueled Brewtality Live! [Disc 2]"
},
{
"Title": "Black Sabbath"
},
{
"Title": "Black Sabbath Vol. 4 (Remaster)"
},
{
"Title": "Body Count"
},
{
"Title": "Chemical Wedding"
},
{
"Title": "The Best Of Buddy Guy - The Millenium Collection"
}
]
}
]
46 changes: 46 additions & 0 deletions relational/query/aggregate_count_artist_albums/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[
{
"rows": [
{
"Name": "Accept",
"Albums": {
"aggregates": {
"how_many_albums": 2
}
}
},
{
"Name": "Aerosmith",
"Albums": {
"aggregates": {
"how_many_albums": 1
}
}
},
{
"Name": "Alanis Morissette",
"Albums": {
"aggregates": {
"how_many_albums": 1
}
}
},
{
"Name": "Alice In Chains",
"Albums": {
"aggregates": {
"how_many_albums": 1
}
}
},
{
"Name": "Antônio Carlos Jobim",
"Albums": {
"aggregates": {
"how_many_albums": 2
}
}
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[
{
"rows": [
{
"Name": "Accept",
"Albums": {
"rows": [
{
"Title": "Balls to the Wall"
},
{
"Title": "Restless and Wild"
}
],
"aggregates": {
"how_many_albums": 2
}
}
},
{
"Name": "Aerosmith",
"Albums": {
"rows": [
{
"Title": "Big Ones"
}
],
"aggregates": {
"how_many_albums": 1
}
}
},
{
"Name": "Alanis Morissette",
"Albums": {
"rows": [
{
"Title": "Jagged Little Pill"
}
],
"aggregates": {
"how_many_albums": 1
}
}
},
{
"Name": "Alice In Chains",
"Albums": {
"rows": [
{
"Title": "Facelift"
}
],
"aggregates": {
"how_many_albums": 1
}
}
},
{
"Name": "Antônio Carlos Jobim",
"Albums": {
"rows": [
{
"Title": "Warner 25 Anos"
},
{
"Title": "Chill: Brazil (Disc 2)"
}
],
"aggregates": {
"how_many_albums": 2
}
}
}
]
}
]
14 changes: 0 additions & 14 deletions relational/query/aggregate_max_enum/request.json

This file was deleted.

7 changes: 0 additions & 7 deletions relational/query/aggregate_max_enum/response.json

This file was deleted.

66 changes: 66 additions & 0 deletions relational/query/dup_array_relationship/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[
{
"rows": [
{
"albums": {
"rows": [
{
"title": "For Those About To Rock We Salute You"
},
{
"title": "Let There Be Rock"
}
]
},
"Albums": {
"rows": [
{
"title": "For Those About To Rock We Salute You"
},
{
"title": "Let There Be Rock"
}
]
}
},
{
"albums": {
"rows": [
{
"title": "Balls to the Wall"
},
{
"title": "Restless and Wild"
}
]
},
"Albums": {
"rows": [
{
"title": "Balls to the Wall"
},
{
"title": "Restless and Wild"
}
]
}
},
{
"albums": {
"rows": [
{
"title": "Big Ones"
}
]
},
"Albums": {
"rows": [
{
"title": "Big Ones"
}
]
}
}
]
}
]
21 changes: 21 additions & 0 deletions relational/query/duplicate_filter_results/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{
"rows": [
{
"Name": "AC/DC"
},
{
"Name": "Accept"
},
{
"Name": "Aerosmith"
},
{
"Name": "Alanis Morissette"
},
{
"Name": "Alice In Chains"
}
]
}
]
Loading

0 comments on commit f9c9c05

Please sign in to comment.