evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a data exploration tool that allows users to query and analyze a dataset through a simple programmatic interface. The tool should enable non-technical users to explore data without writing SQL.
The application should connect to a sample sales dataset with the following columns:
date (datetime): Transaction dateproduct (string): Product nameregion (string): Sales regionrevenue (number): Revenue amountquantity (number): Units soldUsers should be able to retrieve metadata about available columns.
Users should be able to build queries by:
Execute the configured query and return results as an array of objects, where each object represents a row with the requested columns.
Export the query results to CSV format for use in other tools.
getColumns() returns an array with all dataset columns and their types. @test['product', 'revenue'] and executing returns data with only those columns. @testrevenue and executing the query returns the correct total. @testregion = 'US' and executing returns only US region rows. @test/**
* DataExplorer class for querying datasets without SQL
*/
class DataExplorer {
/**
* Initialize with dataset configuration
* @param {Object} config - Configuration object with dataset details
*/
constructor(config) {}
/**
* Get available columns from the dataset
* @returns {Promise<Array<{name: string, type: string}>>} Column metadata
*/
async getColumns() {}
/**
* Select columns to include in query results
* @param {Array<string>} columns - Column names to include
*/
selectColumns(columns) {}
/**
* Add an aggregation metric to the query
* @param {Object} metric - Metric configuration
* @param {string} metric.aggregate - Aggregation function: 'SUM', 'AVG', 'COUNT', 'MIN', 'MAX'
* @param {string} metric.column - Column to aggregate
* @param {string} [metric.label] - Optional display label
*/
addMetric(metric) {}
/**
* Add a filter condition to the query
* @param {Object} filter - Filter configuration
* @param {string} filter.column - Column to filter
* @param {string} filter.operator - Operator: '=', '!=', '>', '<', '>=', '<=', 'IN'
* @param {*} filter.value - Value to compare against
*/
addFilter(filter) {}
/**
* Set time range for date-based filtering
* @param {Object} range - Time range configuration
* @param {string} range.type - 'relative' or 'absolute'
* @param {string|Date} range.start - Start date (for absolute) or relative period (e.g., 'last 7 days')
* @param {string|Date} [range.end] - End date (for absolute ranges)
*/
setTimeRange(range) {}
/**
* Execute the configured query
* @returns {Promise<Array<Object>>} Array of result rows
*/
async execute() {}
/**
* Export query results to CSV format
* @returns {Promise<string>} CSV formatted string
*/
async exportCSV() {}
}
module.exports = { DataExplorer };Provides data exploration and visualization capabilities for building interactive data analysis interfaces.