betodealmeida commented on a change in pull request #13448: URL: https://github.com/apache/superset/pull/13448#discussion_r587796998
########## File path: superset/examples/big_data.py ########## @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from typing import List + +import sqlalchemy.sql.sqltypes + +from superset.utils.data import add_data, ColumnInfo + +COLUMN_TYPES = [ + sqlalchemy.sql.sqltypes.INTEGER(), + sqlalchemy.sql.sqltypes.VARCHAR(length=255), + sqlalchemy.sql.sqltypes.TEXT(), + sqlalchemy.sql.sqltypes.BOOLEAN(), + sqlalchemy.sql.sqltypes.FLOAT(), + sqlalchemy.sql.sqltypes.DATE(), + sqlalchemy.sql.sqltypes.TIME(), + sqlalchemy.sql.sqltypes.DATETIME(), +] + + +def load_big_data() -> None: + # create table with 100 columns to test SQL Lab + columns: List[ColumnInfo] = [] + for i in range(100): Review comment: Right now we have only this one table, but I think eventually will have the command generating multiple tables, so passing arguments on the CLI would quickly become messy, IMHO. But I love the idea of configuring the tables being generated. Maybe we could create a mini DSL? For example: ```yaml # big_data.yaml tables - wide_table: name: wide_table table_count: 1 row_count: 1000 columns: 100 - many_small_tables: name: small_table_{i} table_count: 1000 row_count: 10 columns: - id: type: INTEGER primary_key: true - value: type: FLOAT ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
