diff --git a/.github/workflows/ci_parquetindex_demo.yml b/.github/workflows/ci_parquetindex_demo.yml
new file mode 100644
index 0000000..3f651a1
--- /dev/null
+++ b/.github/workflows/ci_parquetindex_demo.yml
@@ -0,0 +1,15 @@
+name: parquetindex-demo
+on:
+ workflow_dispatch:
+ push:
+ branches: ["master"]
+ pull_request:
+ paths:
+ - 'parquetindex/**'
+ - '.github/workflows/_common_jobs.yml'
+ - '.github/workflows/ci_parquetindex_demo.yml'
+jobs:
+ ci:
+ uses: ./.github/workflows/_common_jobs.yml
+ with:
+ workspace: parquetindex
diff --git a/parquetindex/.gitignore b/parquetindex/.gitignore
new file mode 100644
index 0000000..8047ad7
--- /dev/null
+++ b/parquetindex/.gitignore
@@ -0,0 +1,19 @@
+package-lock.json
+node_modules
+dist
+
+# Logs
+logs
+*.log
+npm-debug.log*
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/parquetindex/LICENSE b/parquetindex/LICENSE
new file mode 100644
index 0000000..5523c36
--- /dev/null
+++ b/parquetindex/LICENSE
@@ -0,0 +1,7 @@
+The MIT License (MIT)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/parquetindex/README.md b/parquetindex/README.md
new file mode 100644
index 0000000..caf1d2b
--- /dev/null
+++ b/parquetindex/README.md
@@ -0,0 +1,17 @@
+# Hyparquet demo
+
+This is an example project showing how to use [hyparquet](https://github.com/hyparam/hyparquet).
+
+## Build
+
+```bash
+npm i
+npm run build
+```
+
+The build artifacts will be stored in the `dist/` directory and can be served using any static server, eg. `http-server`:
+
+```bash
+npm i -g http-server
+http-server dist/
+```
diff --git a/parquetindex/eslint.config.js b/parquetindex/eslint.config.js
new file mode 100644
index 0000000..d0c982b
--- /dev/null
+++ b/parquetindex/eslint.config.js
@@ -0,0 +1,82 @@
+import js from '@eslint/js'
+import react from 'eslint-plugin-react'
+import reactHooks from 'eslint-plugin-react-hooks'
+import reactRefresh from 'eslint-plugin-react-refresh'
+import globals from 'globals'
+import tseslint from 'typescript-eslint'
+
+export default tseslint.config(
+ { ignores: ['dist', 'coverage', 'node_modules'] },
+ {
+ extends: [
+ js.configs.recommended,
+ ...tseslint.configs.strictTypeChecked,
+ ...tseslint.configs.stylisticTypeChecked
+ ],
+ // Set the react version
+ settings: { react: { version: '18.3' } },
+ files: ['src/**/*.{ts,tsx}'],
+ languageOptions: {
+ ecmaVersion: 2020,
+ globals: globals.browser,
+ parserOptions: {
+ project: './tsconfig.json',
+ tsconfigRootDir: import.meta.dirname,
+ },
+ },
+ plugins: {
+ react,
+ 'react-hooks': reactHooks,
+ 'react-refresh': reactRefresh,
+ },
+ rules: {
+ ...react.configs.recommended.rules,
+ ...react.configs['jsx-runtime'].rules,
+ ...reactHooks.configs.recommended.rules,
+ 'react-refresh/only-export-components': [
+ 'warn',
+ { allowConstantExport: true },
+ ],
+ ...js.configs.recommended.rules,
+ ...tseslint.configs.recommended.rules,
+
+ 'arrow-spacing': 'error',
+ camelcase: 'off',
+ 'comma-spacing': 'error',
+ 'comma-dangle': ['error', 'always-multiline'],
+ 'eol-last': 'error',
+ eqeqeq: 'error',
+ 'func-style': ['error', 'declaration'],
+ indent: ['error', 2],
+ 'key-spacing': 'error',
+ 'no-constant-condition': 'off',
+ 'no-extra-parens': 'error',
+ 'no-multi-spaces': 'error',
+ 'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
+ 'no-trailing-spaces': 'error',
+ 'no-unused-vars': 'off',
+ 'no-useless-concat': 'error',
+ 'no-useless-rename': 'error',
+ 'no-useless-return': 'error',
+ 'no-var': 'error',
+ 'object-curly-spacing': ['error', 'always'],
+ 'prefer-const': 'warn',
+ 'prefer-destructuring': ['warn', {
+ object: true,
+ array: false,
+ }],
+ 'prefer-promise-reject-errors': 'error',
+ quotes: ['error', 'single'],
+ 'require-await': 'warn',
+ semi: ['error', 'never'],
+ 'sort-imports': ['error', {
+ ignoreDeclarationSort: true,
+ ignoreMemberSort: false,
+ memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
+ }],
+ 'space-infix-ops': 'error',
+ '@typescript-eslint/restrict-template-expressions': 'off',
+ '@typescript-eslint/no-unused-vars': 'warn',
+ },
+ },
+)
diff --git a/parquetindex/index.html b/parquetindex/index.html
new file mode 100644
index 0000000..1f7488d
--- /dev/null
+++ b/parquetindex/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+ parquetindex full text search demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/parquetindex/package.json b/parquetindex/package.json
new file mode 100644
index 0000000..9cf26f0
--- /dev/null
+++ b/parquetindex/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "hyparquet-demo",
+ "private": true,
+ "version": "0.1.0",
+ "license": "MIT",
+ "type": "module",
+ "scripts": {
+ "coverage": "vitest run --coverage --coverage.include=src",
+ "dev": "vite",
+ "build": "tsc -b && vite build",
+ "lint": "eslint .",
+ "preview": "vite preview",
+ "test": "vitest run --dir test",
+ "typecheck": "tsc"
+ },
+ "dependencies": {
+ "hightable": "0.26.4",
+ "hyparquet": "1.25.6",
+ "hyparquet-compressors": "1.1.1",
+ "hyperparam": "0.4.14",
+ "parquetindex": "0.1.0",
+ "react": "19.2.5",
+ "react-dom": "19.2.5"
+ },
+ "devDependencies": {
+ "@types/react": "19.2.14",
+ "@types/react-dom": "19.2.3",
+ "@vitejs/plugin-react": "6.0.1",
+ "@vitest/coverage-v8": "4.1.5",
+ "eslint": "9.39.4",
+ "eslint-plugin-react": "7.37.5",
+ "eslint-plugin-react-hooks": "7.1.1",
+ "eslint-plugin-react-refresh": "0.5.2",
+ "globals": "17.6.0",
+ "typescript": "6.0.3",
+ "typescript-eslint": "8.59.1",
+ "vite": "8.0.10",
+ "vitest": "4.1.5"
+ }
+}
diff --git a/parquetindex/public/favicon.svg b/parquetindex/public/favicon.svg
new file mode 100644
index 0000000..8d5c22d
--- /dev/null
+++ b/parquetindex/public/favicon.svg
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/parquetindex/src/App.tsx b/parquetindex/src/App.tsx
new file mode 100644
index 0000000..73220f4
--- /dev/null
+++ b/parquetindex/src/App.tsx
@@ -0,0 +1,49 @@
+import { ReactNode } from 'react'
+import Page, { PageProps } from './Page.js'
+import Welcome from './Welcome.js'
+
+import { sortableDataFrame } from 'hightable'
+import { byteLengthFromUrl, parquetMetadataAsync } from 'hyparquet'
+import { AsyncBufferFrom, asyncBufferFrom, parquetDataFrame } from 'hyperparam'
+import { useCallback, useEffect, useState } from 'react'
+import Layout from './Layout.js'
+
+export default function App(): ReactNode {
+ const params = new URLSearchParams(location.search)
+ const url = params.get('key') ?? undefined
+
+ const [error, setError] = useState()
+ const [pageProps, setPageProps] = useState()
+
+ const setUnknownError = useCallback((e: unknown) => {
+ setError(e instanceof Error ? e : new Error(String(e)))
+ }, [])
+
+ const setAsyncBuffer = useCallback(async function setAsyncBuffer(name: string, from: AsyncBufferFrom) {
+ const asyncBuffer = await asyncBufferFrom(from)
+ const metadata = await parquetMetadataAsync(asyncBuffer)
+ const df = sortableDataFrame(parquetDataFrame(from, metadata))
+ setPageProps({ metadata, df, name, byteLength: from.byteLength, setError: setUnknownError })
+ }, [setUnknownError])
+
+ const onUrlDrop = useCallback(
+ (url: string) => {
+ // Add key=url to query string
+ const params = new URLSearchParams(location.search)
+ params.set('key', url)
+ history.pushState({}, '', `${location.pathname}?${params}`)
+ byteLengthFromUrl(url).then(byteLength => setAsyncBuffer(url, { url, byteLength })).catch(setUnknownError)
+ },
+ [setUnknownError, setAsyncBuffer],
+ )
+
+ useEffect(() => {
+ if (!pageProps && url) {
+ onUrlDrop(url)
+ }
+ }, [url, pageProps, onUrlDrop])
+
+ return
+ {pageProps ? : }
+
+}
diff --git a/parquetindex/src/Layout.tsx b/parquetindex/src/Layout.tsx
new file mode 100644
index 0000000..49a9491
--- /dev/null
+++ b/parquetindex/src/Layout.tsx
@@ -0,0 +1,36 @@
+import { ErrorBar, cn } from 'hyperparam'
+import type { ReactNode } from 'react'
+
+interface LayoutProps {
+ children: ReactNode
+ className?: string
+ progress?: number
+ error?: Error
+}
+
+/**
+ * Layout for shared UI.
+ * Content div style can be overridden by className prop.
+ *
+ * @param {Object} props
+ * @param {ReactNode} props.children - content to display inside the layout
+ * @param {string | undefined} props.className - additional class names to apply to the content container
+ * @param {number | undefined} props.progress - progress bar value
+ * @param {Error} props.error - error message to display
+ * @returns {ReactNode}
+ */
+export default function Layout({ children, className, progress, error }: LayoutProps): ReactNode {
+ return <>
+
+ {progress !== undefined && progress < 1 &&
+
+ }
+ >
+}
diff --git a/parquetindex/src/Page.tsx b/parquetindex/src/Page.tsx
new file mode 100644
index 0000000..15f312c
--- /dev/null
+++ b/parquetindex/src/Page.tsx
@@ -0,0 +1,175 @@
+import HighTable, { CellContentProps } from 'hightable'
+import { DataFrame, arrayDataFrame } from 'hightable/dataframe'
+import { AsyncBuffer, FileMetaData, asyncBufferFromUrl, cachedAsyncBuffer, parquetMetadataAsync } from 'hyparquet'
+import { parquetFind } from 'parquetindex'
+import { ReactNode, useCallback, useEffect, useState } from 'react'
+
+export interface PageProps {
+ metadata: FileMetaData
+ df: DataFrame
+ name: string
+ byteLength?: number
+ setError: (e: unknown) => void
+}
+
+const asyncBufferCache = new Map>()
+function asyncBufferFactory({ url, byteLength }: { url: string; byteLength?: number }): Promise {
+ let cached = asyncBufferCache.get(url)
+ if (!cached) {
+ cached = asyncBufferFromUrl({ url, byteLength }).then(cachedAsyncBuffer)
+ asyncBufferCache.set(url, cached)
+ }
+ return cached
+}
+
+/**
+ * Parquetindex demo page
+ * Try "Vongphachanh" or "gratianopolitanus" as a search term
+ *
+ * @param {Object} props
+ * @returns {ReactNode}
+ */
+export default function Page({ df, name, byteLength, setError }: PageProps): ReactNode {
+ const [query, setQuery] = useState('')
+ const [queryResultsDf, setQueryResultsDf] = useState(df)
+ const [queryTime, setQueryTime] = useState()
+ const [firstRowTime, setFirstRowTime] = useState()
+ const [indexMetadata, setIndexMetadata] = useState()
+
+ const isQuerying = query.length > 2
+ const filteredDf = isQuerying ? queryResultsDf : df
+ const displayQueryTime = isQuerying ? queryTime : undefined
+ const displayFirstRowTime = isQuerying ? firstRowTime : undefined
+
+ useEffect(() => {
+ if (!isQuerying) return
+ const controller = new AbortController()
+ const { signal } = controller
+
+ async function updateQuery() {
+ console.log(`Querying for "${query}"...`)
+ setQueryTime(undefined)
+ setFirstRowTime(undefined)
+ const resultsDf = arrayDataFrame([], [], {
+ columnDescriptors: df.columnDescriptors.map(({ name }) => ({ name })),
+ })
+ const results = resultsDf._array
+ const rowNumbers = resultsDf._rowNumbers
+ setQueryResultsDf(resultsDf)
+ const startTime = performance.now()
+ // Query against the parquetindex
+ const url = name
+ const rowGen = parquetFind({
+ url,
+ query,
+ limit: 20,
+ asyncBufferFactory,
+ indexMetadata,
+ sourceMetadata: df.metadata?.parquet as FileMetaData | undefined,
+ signal,
+ })
+ for await (const row of rowGen) {
+ // Extract row numbers from __index__
+ if (!results.length) {
+ const elapsed = performance.now() - startTime
+ console.log(`First result for "${query}" in ${elapsed.toFixed(2)} ms`)
+ setFirstRowTime(elapsed)
+ }
+ rowNumbers?.push(row.__index__ as number)
+ delete row.__index__
+ results.push(row)
+ }
+ const elapsed = performance.now() - startTime
+ setQueryTime(elapsed)
+ console.log(`Query result for "${query}" in ${elapsed.toFixed(2)} ms, ${results.length} results`, results)
+ }
+ void updateQuery().catch((err: unknown) => {
+ if (signal.aborted) return
+ setError(err)
+ })
+
+ return () => { controller.abort(new Error('Query aborted')) }
+ }, [isQuerying, query, indexMetadata, df, name, setError])
+
+ // preload index metadata
+ useEffect(() => {
+ const url = name.replace(/\.parquet$/i, '.index.parquet')
+ asyncBufferFactory({ url })
+ .then(buffer => parquetMetadataAsync(buffer))
+ .then(setIndexMetadata)
+ .catch(setError)
+ }, [name, setError])
+
+ const renderCellContent = useCallback(({ cell, stringify }: CellContentProps) => {
+ // Find first keyword match and highlight it
+ const queryKeys = query.split(' ').map(q => q.toLowerCase())
+ const value: unknown = cell?.value
+ if (typeof value === 'string' && queryKeys.length > 0) {
+ const lowerValue = value.toLowerCase()
+ let firstIndex = -1
+ let firstLength = 0
+ for (const q of queryKeys) {
+ const index = lowerValue.indexOf(q)
+ if (index >= 0 && (firstIndex === -1 || index < firstIndex)) {
+ firstIndex = index
+ firstLength = q.length
+ }
+ }
+ if (firstIndex >= 0) {
+ const truncateBefore = firstIndex > 20 ? '...' : ''
+ return <>
+ {truncateBefore}
+ {value.slice(0, firstIndex).slice(-20)}
+ {value.slice(firstIndex, firstIndex + firstLength)}
+ {value.slice(firstIndex + firstLength)}
+ >
+ }
+ }
+ return stringify(value)
+ }, [query])
+
+ return <>
+
+ {name}
+
+
+ {byteLength !== undefined &&
{formatFileSize(byteLength)} }
+
{df.numRows.toLocaleString()} rows
+
+ {displayQueryTime !== undefined && query time: {displayQueryTime.toFixed(0)} ms }
+ {displayFirstRowTime !== undefined && first result: {displayFirstRowTime.toFixed(0)} ms }
+ { setQuery(e.target.value) }}
+ value={query}
+ style={{ padding: '2px 10px', marginLeft: 'auto', height: '24px' }}
+ />
+
+
+
+ >
+}
+
+/**
+ * Returns the file size in human readable format.
+ *
+ * @param {number} bytes file size in bytes
+ * @returns {string} formatted file size string
+ */
+function formatFileSize(bytes: number): string {
+ const sizes = ['b', 'kb', 'mb', 'gb', 'tb']
+ if (bytes === 0) return '0 b'
+ const i = Math.floor(Math.log2(bytes) / 10)
+ if (i === 0) return `${bytes} b`
+ const base = bytes / Math.pow(1024, i)
+ return `${base < 10 ? base.toFixed(1) : Math.round(base)} ${sizes[i]}`
+}
diff --git a/parquetindex/src/Welcome.tsx b/parquetindex/src/Welcome.tsx
new file mode 100644
index 0000000..0183794
--- /dev/null
+++ b/parquetindex/src/Welcome.tsx
@@ -0,0 +1,34 @@
+import type { ReactNode } from 'react'
+
+export default function Welcome(): ReactNode {
+
+ return
+
+
parquetindex
+
Full text search against cloud-stored parquet files
+
+
+
+
+
+ Online demo of parquetindex : a library for building full text search indexes
+ against parquet files stored in cloud object storage (S3, Azure Blob Storage, etc).
+
+
+ This demo uses hightable for high performance table viewing.
+
+
+ Example file:
+
+
+
+
+}
diff --git a/parquetindex/src/assets/demo.png b/parquetindex/src/assets/demo.png
new file mode 100644
index 0000000..b109e8a
Binary files /dev/null and b/parquetindex/src/assets/demo.png differ
diff --git a/parquetindex/src/assets/s3.svg b/parquetindex/src/assets/s3.svg
new file mode 100644
index 0000000..400f3c9
--- /dev/null
+++ b/parquetindex/src/assets/s3.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/parquetindex/src/index.css b/parquetindex/src/index.css
new file mode 100644
index 0000000..ed97708
--- /dev/null
+++ b/parquetindex/src/index.css
@@ -0,0 +1,284 @@
+* {
+ box-sizing: border-box;
+ font-family: 'Mulish', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ margin: 0;
+ padding: 0;
+}
+body {
+ display: flex;
+ height: 100vh;
+ width: 100vw;
+}
+
+h1 {
+ font-size: 22pt;
+}
+h2 {
+ margin-top: 10px;
+ font-size: 12pt;
+}
+label {
+ margin: 15px 0;
+ display: block;
+}
+p {
+ margin: 15px 0;
+}
+code {
+ font-family: monospace;
+ padding: 10px;
+ white-space: pre-wrap;
+ word-break: break-all;
+}
+
+input {
+ height: 32px;
+}
+input,
+textarea {
+ border: 2px solid #999;
+ border-radius: 8px;
+ padding: 4px 8px;
+ transition: border 0.3s;
+}
+input:focus,
+textarea:focus {
+ outline: none;
+ border: 2px solid #99e;
+}
+
+/* sidebar */
+nav.sidebar {
+ height: 100vh;
+ width: 48px;
+ height: 100vh;
+}
+nav.sidebar > div {
+ background: #eef0f9;
+ box-shadow: 0 0 6px rgba(10, 10, 10, 0.4);
+ height: 100vh;
+ position: absolute;
+ width: 48px;
+ z-index: 30;
+}
+
+/* brand logo */
+.brand {
+ align-items: center;
+ color: #111;
+ display: flex;
+ filter: drop-shadow(0 0 2px #bbb);
+ font-family: 'Century Gothic', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ font-size: 1.1em;
+ font-weight: bold;
+ letter-spacing: 0.3px;
+ opacity: 0.9;
+ padding: 10px 12px;
+ text-decoration: none;
+ text-orientation: mixed;
+ user-select: none;
+ writing-mode: vertical-rl;
+}
+.brand:hover {
+ color: #111;
+ filter: drop-shadow(0 0 2px #afa6b9);
+ opacity: 1;
+ text-decoration: none;
+}
+.brand::before {
+ content: '';
+ background: url(logo.svg) no-repeat 0 center;
+ background-size: 26px;
+ height: 26px;
+ width: 26px;
+ margin-bottom: 10px;
+}
+
+/* content area */
+main {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ min-width: 0;
+}
+
+#app {
+ flex: 1;
+}
+
+/* content area */
+.content-container {
+ min-width: 0;
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+}
+.content {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ height: 100vh;
+ padding: 0;
+ /* no outer scrollbars */
+ overflow: hidden;
+}
+
+.top-header {
+ align-items: center;
+ border-bottom: 1px solid #ddd;
+ border-radius: 8px;
+ background: #333;
+ color: #eee;
+ display: flex;
+ font-size: 16px;
+ font-weight: 600;
+ height: 32px;
+ justify-content: space-between;
+ min-height: 32px;
+ margin: 5px;
+ padding: 20px;
+ text-decoration-thickness: 1px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.view-header {
+ align-items: center;
+ color: #444;
+ display: flex;
+ font-size: 10pt;
+ gap: 16px;
+ height: 22px;
+ padding: 0 8px;
+ /* all one line */
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.viewer {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ white-space: pre-wrap;
+ overflow-y: auto;
+}
+.spacer {
+ display: flex;
+ align-items: center;
+ margin-left: auto;
+ gap: 10px;
+}
+
+/* welcome */
+#welcome {
+ display: flex;
+ flex-direction: column;
+ font-size: 20px;
+ height: 100vh;
+ width: 100%;
+ padding: 10px;
+ overflow-y: auto;
+}
+#welcome > div {
+ display: flex;
+ flex-direction: column;
+ margin: auto;
+ max-width: 640px;
+}
+.inputGroup {
+ display: flex;
+ gap: 10px;
+}
+.inputGroup > input {
+ flex: 1;
+}
+/* quick link buttons */
+.quick-links {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px;
+ list-style: none;
+}
+.quick-links li {
+ display: flex;
+ flex: 1 1 calc(50% - 10px);
+ min-width: 0;
+}
+.quick-links a {
+ background-position: 10px center;
+ background-size: 18px;
+ border: 1px solid #ddd;
+ border-radius: 8px;
+ color: #333;
+ font-size: 8pt;
+ overflow: hidden;
+ padding: 12px;
+ padding-left: 36px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ width: 100%;
+ transition: background-color 0.2s, border-color 0.2s;
+}
+.quick-links a:hover {
+ background-color: #4433aa11;
+ border-color: #43a;
+ color: #43a;
+ text-decoration: none;
+}
+.aws {
+ background: url('assets/s3.svg') no-repeat 8px center;
+}
+.badges {
+ display: flex;
+ gap: 10px;
+}
+
+/* layout */
+.layout {
+ margin: 10px;
+ max-width: 480px;
+}
+.layout,
+.layout .group,
+.layout .cell {
+ background-color: rgba(100, 80, 180, 0.05);
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ font-size: 12px;
+ margin-top: 4px;
+ padding: 4px;
+ word-break: break-all;
+}
+.cell,
+.group-header {
+ display: flex;
+}
+.group-header > label,
+.cell > label {
+ display: flex;
+ flex: 1;
+ font-size: 12px;
+ font-weight: normal;
+ justify-content: flex-start;
+}
+.group-header > span {
+ font-size: 10px;
+}
+
+.layout div ul {
+ list-style: none;
+}
+.layout div li {
+ font-size: 10px;
+ padding: 2px 4px;
+ text-align: right;
+}
+
+.hightable thead td:first-child {
+ background: url('https://hyperparam.app/assets/table/hyparquet.svg') #f9f4ff no-repeat center 6px;
+}
+
+.json {
+ background-color: #22222b;
+ padding-left: 20px;
+}
diff --git a/parquetindex/src/logo.svg b/parquetindex/src/logo.svg
new file mode 100644
index 0000000..90903e2
--- /dev/null
+++ b/parquetindex/src/logo.svg
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/parquetindex/src/main.tsx b/parquetindex/src/main.tsx
new file mode 100644
index 0000000..94a6585
--- /dev/null
+++ b/parquetindex/src/main.tsx
@@ -0,0 +1,14 @@
+import 'hightable/src/HighTable.css'
+import 'hyperparam/global.css'
+import 'hyperparam/hyperparam.css'
+import { StrictMode } from 'react'
+import ReactDOM from 'react-dom/client'
+import App from './App.js'
+import './index.css'
+
+const app = document.getElementById('app')
+if (!app) throw new Error('missing app element')
+
+ReactDOM.createRoot(app).render(
+
+ )
diff --git a/parquetindex/src/vite-env.d.ts b/parquetindex/src/vite-env.d.ts
new file mode 100644
index 0000000..11f02fe
--- /dev/null
+++ b/parquetindex/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/parquetindex/test/package.test.js b/parquetindex/test/package.test.js
new file mode 100644
index 0000000..a4fd020
--- /dev/null
+++ b/parquetindex/test/package.test.js
@@ -0,0 +1,21 @@
+import { describe, expect, it } from 'vitest'
+import packageJson from '../package.json' with { type: 'json' }
+
+describe('package.json', () => {
+ it('should have the correct name', () => {
+ expect(packageJson.name).toBe('hyparquet-demo')
+ })
+ it('should have a valid version', () => {
+ expect(packageJson.version).toMatch(/^\d+\.\d+\.\d+$/)
+ })
+ it('should have MIT license', () => {
+ expect(packageJson.license).toBe('MIT')
+ })
+ it('should have precise dependency versions', () => {
+ const { dependencies, devDependencies } = packageJson
+ const allDependencies = { ...dependencies, ...devDependencies }
+ Object.values(allDependencies).forEach(version => {
+ expect(version).toMatch(/^\d+\.\d+\.\d+$/)
+ })
+ })
+})
diff --git a/parquetindex/tsconfig.json b/parquetindex/tsconfig.json
new file mode 100644
index 0000000..243bf41
--- /dev/null
+++ b/parquetindex/tsconfig.json
@@ -0,0 +1,26 @@
+{
+ "compilerOptions": {
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
+ "target": "ES2020",
+ "useDefineForClassFields": true,
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "Bundler",
+ "allowImportingTsExtensions": true,
+ "isolatedModules": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+ "jsx": "react-jsx",
+
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true,
+ "noUncheckedSideEffectImports": true
+ },
+ "include": ["src"]
+}
diff --git a/parquetindex/vite.config.ts b/parquetindex/vite.config.ts
new file mode 100644
index 0000000..0299086
--- /dev/null
+++ b/parquetindex/vite.config.ts
@@ -0,0 +1,11 @@
+import react from '@vitejs/plugin-react'
+import { defineConfig } from 'vite'
+
+// https://vite.dev/config/
+export default defineConfig({
+ plugins: [react()],
+ optimizeDeps: {
+ exclude: ["hyperparam"],
+ },
+ base: './',
+})