stasaking commited on
Commit
fb46b26
·
verified ·
1 Parent(s): 58eeeb9

Upload main.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -95,12 +95,12 @@ def startup():
95
  mode = "remote httpfs" if is_remote else "local files"
96
  print(f"Data mode: {mode}")
97
 
98
- # Create views that query Parquet remotely via httpfs range requests.
99
- # No data copied into RAM — DuckDB fetches only needed columns/rows per query.
100
  db.execute(f"""
101
- CREATE VIEW results AS
102
  SELECT * FROM read_parquet('{results_src}')
103
  """)
 
104
  db.execute(f"""
105
  CREATE VIEW features AS
106
  SELECT * FROM read_parquet('{features_src}')
 
95
  mode = "remote httpfs" if is_remote else "local files"
96
  print(f"Data mode: {mode}")
97
 
98
+ # Results: loaded into memory (47MB — small, queried on every page load)
 
99
  db.execute(f"""
100
+ CREATE TABLE results AS
101
  SELECT * FROM read_parquet('{results_src}')
102
  """)
103
+ # Features: remote view (only fetched on demand for feature deep dives)
104
  db.execute(f"""
105
  CREATE VIEW features AS
106
  SELECT * FROM read_parquet('{features_src}')