Description
Steps to reproduce:
Create the following using a 4.14.3 client and 4.14.3 server on a single node pseudo-distributed mode of HBase 1.3 server:
- Data table (Z_BASE_TABLE):
CREATE TABLE IF NOT EXISTS Z_BASE_TABLE (ID INTEGER NOT NULL PRIMARY KEY, HOST VARCHAR(10), FLAG BOOLEAN);
- View (Z_VIEW1)
CREATE VIEW Z_VIEW1 (col1 INTEGER, col2 INTEGER, col3 INTEGER, col4 INTEGER, col5 INTEGER) AS SELECT * FROM Z_BASE_TABLE WHERE ID>10;
- Stop HBase
- Replace the server jar with the latest 4.15.0 jar
- Restart HBase and then connect using a 4.15.0 client in sqlline.
*This triggers the upgradeSystemTables code path, and populates parent->child links inside SYSTEM.CHILD_LINK, but the links are not removed from SYSTEM.CATALOG.
$ ./bin/sqlline.py 0: jdbc:phoenix:> select * from system.child_link; 'TENANT_ID','TABLE_SCHEM','TABLE_NAME','COLUMN_NAME','COLUMN_FAMILY','LINK_TYPE' '','','Z_BASE_TABLE','','Z_VIEW1','4' *1 row selected (0.006 seconds)*
As expected. But:
0: jdbc:phoenix:> select * from system.catalog where link_type=4; 'TENANT_ID','TABLE_SCHEM','TABLE_NAME','COLUMN_NAME','COLUMN_FAMILY','TABLE_SEQ_NUM','TABLE_TYPE','PK_NAME','COLUMN_COUNT','SALT_BUCKETS','DATA_TABLE_NAME','INDEX_STATE','IMMUTABLE_ROWS','VIEW_STATEMENT','DEFAULT_COLUMN_FAMILY','DISABLE_WAL','MULTI_TENANT','VIEW_TYPE','VIEW_INDEX_ID','DATA_TYPE','COLUMN_SIZE','DECIMAL_DIGITS','NULLABLE','ORDINAL_POSITION','SORT_ORDER','ARRAY_SIZE','VIEW_CONSTANT','IS_VIEW_REFERENCED','KEY_SEQ','LINK_TYPE','TYPE_NAME','REMARKS','SELF_REFERENCING_COL_NAME','REF_GENERATION','BUFFER_LENGTH','NUM_PREC_RADIX','COLUMN_DEF','SQL_DATA_TYPE','SQL_DATETIME_SUB','CHAR_OCTET_LENGTH','IS_NULLABLE','SCOPE_CATALOG','SCOPE_SCHEMA','SCOPE_TABLE','SOURCE_DATA_TYPE','IS_AUTOINCREMENT','INDEX_TYPE','INDEX_DISABLE_TIMESTAMP','STORE_NULLS','BASE_COLUMN_COUNT','IS_ROW_TIMESTAMP','TRANSACTIONAL','UPDATE_CACHE_FREQUENCY','IS_NAMESPACE_MAPPED','AUTO_PARTITION_SEQ','APPEND_ONLY_SCHEMA','GUIDE_POSTS_WIDTH','COLUMN_QUALIFIER','IMMUTABLE_STORAGE_SCHEME','ENCODING_SCHEME','QUALIFIER_COUNTER','USE_STATS_FOR_PARALLELIZATION','TRANSACTION_PROVIDER','VIEW_INDEX_ID_DATA_TYPE' '','','Z_BASE_TABLE','','Z_VIEW1','null','','','null','null','','','','','','','','null','null','null','null','null','null','null','null','null','','','null','4','','','','','null','null','','null','null','null','','','','','null','','null','null','','null','','','null','','','','null','','null','null','null','','null','null' *1 row selected (0.008 seconds)*
Which is not expected.