| # |
| # 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. |
| # |
| |
| # Creates 5 RDBMS Metastore tables component tables: TABLES, SEGMENTS, FILES, ROW_GROUPS, PARTITIONS. |
| # Note: the RDBMS Drill Metastore schema is slightly denormalized, see explanation in README.md (section Tables structure). |
| databaseChangeLog: |
| # to preserve upper case naming in some DBs (ex: PostgreSQL) and quote reserved column names (ex: COLUMN) |
| - objectQuotingStrategy: QUOTE_ALL_OBJECTS |
| - changeSet: |
| id: 1 |
| author: arina |
| changes: |
| - createTable: |
| tableName: TABLES |
| columns: |
| - column: |
| name: STORAGE_PLUGIN |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: WORKSPACE |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: TABLE_NAME |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: OWNER |
| type: VARCHAR(100) |
| - column: |
| name: TABLE_TYPE |
| type: VARCHAR(100) |
| - column: |
| name: METADATA_KEY |
| type: VARCHAR(100) |
| constraints: |
| nullable: false |
| - column: |
| name: METADATA_TYPE |
| type: VARCHAR(100) |
| constraints: |
| nullable: false |
| - column: |
| name: LOCATION |
| type: VARCHAR(500) |
| - column: |
| name: INTERESTING_COLUMNS |
| type: CLOB |
| - column: |
| name: SCHEMA |
| type: CLOB |
| - column: |
| name: COLUMN_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: METADATA_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: PARTITION_KEYS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: LAST_MODIFIED_TIME |
| type: BIGINT |
| constraints: |
| nullable: false |
| - column: |
| name: ADDITIONAL_METADATA |
| type: CLOB |
| |
| - createTable: |
| tableName: SEGMENTS |
| columns: |
| - column: |
| name: STORAGE_PLUGIN |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: WORKSPACE |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: TABLE_NAME |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_KEY |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_IDENTIFIER |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_TYPE |
| type: VARCHAR(100) |
| constraints: |
| nullable: false |
| - column: |
| name: LOCATION |
| type: VARCHAR(500) |
| constraints: |
| nullable: false |
| - column: |
| name: SCHEMA |
| type: CLOB |
| - column: |
| name: COLUMN_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: METADATA_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: COLUMN |
| type: VARCHAR(100) |
| - column: |
| name: LOCATIONS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: PARTITION_VALUES |
| type: CLOB |
| - column: |
| name: PATH |
| type: VARCHAR(500) |
| - column: |
| name: LAST_MODIFIED_TIME |
| type: BIGINT |
| constraints: |
| nullable: false |
| - column: |
| name: ADDITIONAL_METADATA |
| type: CLOB |
| |
| - createTable: |
| tableName: FILES |
| columns: |
| - column: |
| name: STORAGE_PLUGIN |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: WORKSPACE |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: TABLE_NAME |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_KEY |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_IDENTIFIER |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_TYPE |
| type: VARCHAR(100) |
| constraints: |
| nullable: false |
| - column: |
| name: LOCATION |
| type: VARCHAR(500) |
| constraints: |
| nullable: false |
| - column: |
| name: SCHEMA |
| type: CLOB |
| - column: |
| name: COLUMN_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: METADATA_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: PATH |
| type: VARCHAR(500) |
| constraints: |
| nullable: false |
| - column: |
| name: LAST_MODIFIED_TIME |
| type: BIGINT |
| constraints: |
| nullable: false |
| - column: |
| name: ADDITIONAL_METADATA |
| type: CLOB |
| |
| - createTable: |
| tableName: ROW_GROUPS |
| columns: |
| - column: |
| name: STORAGE_PLUGIN |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: WORKSPACE |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: TABLE_NAME |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_KEY |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_IDENTIFIER |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_TYPE |
| type: VARCHAR(100) |
| constraints: |
| nullable: false |
| - column: |
| name: LOCATION |
| type: VARCHAR(500) |
| constraints: |
| nullable: false |
| - column: |
| name: SCHEMA |
| type: CLOB |
| - column: |
| name: COLUMN_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: METADATA_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: PATH |
| type: VARCHAR(500) |
| constraints: |
| nullable: false |
| - column: |
| name: ROW_GROUP_INDEX |
| type: INT |
| constraints: |
| nullable: false |
| - column: |
| name: HOST_AFFINITY |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: LAST_MODIFIED_TIME |
| type: BIGINT |
| constraints: |
| nullable: false |
| - column: |
| name: ADDITIONAL_METADATA |
| type: CLOB |
| |
| - createTable: |
| tableName: PARTITIONS |
| columns: |
| - column: |
| name: STORAGE_PLUGIN |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: WORKSPACE |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: TABLE_NAME |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_KEY |
| type: VARCHAR(100) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_IDENTIFIER |
| type: VARCHAR(500) |
| constraints: |
| primaryKey: true |
| nullable: false |
| - column: |
| name: METADATA_TYPE |
| type: VARCHAR(100) |
| constraints: |
| nullable: false |
| - column: |
| name: SCHEMA |
| type: CLOB |
| - column: |
| name: COLUMN_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: METADATA_STATISTICS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: COLUMN |
| type: VARCHAR(100) |
| constraints: |
| nullable: false |
| - column: |
| name: LOCATIONS |
| type: CLOB |
| constraints: |
| nullable: false |
| - column: |
| name: PARTITION_VALUES |
| type: CLOB |
| - column: |
| name: LAST_MODIFIED_TIME |
| type: BIGINT |
| constraints: |
| nullable: false |
| - column: |
| name: ADDITIONAL_METADATA |
| type: CLOB |