First, env: 
hive 3.1.2 
hadoop3.0.0-cdh 6.3.2.
I upgraded kylin to 3.1.2 - hadoop3.

It doesn't load when I try to create a new project and load the table in.
And KYLIN WEB UI dispaly "cannot get HiveTableMeta".
Then I went to check the log. Throw Exception:


```
Caused by: java.lang.RuntimeException: cannot get HiveTableMeta
                at 
org.apache.kylin.source.hive.HiveMetadataExplorer.loadTableMetadata(HiveMetadataExplorer.java:68)
                at 
org.apache.kylin.rest.service.TableService.extractHiveTableMeta(TableService.java:260)
                ...
Caused by: java.lang.IllegalArgumentException
                at 
org.apache.kylin.shade.com.google.common.base.Preconditions.checkArgument(Preconditions.java:128)
                at 
org.apache.kylin.source.hive.BeelineHiveClient.parseResultEntry(BeelineHiveClient.java:251)
                ...
```


When I see this exception. I think there's a problem with one of the parameters.
So I looked at the corresponding source code.


```
private void parseResultEntry(ResultSet resultSet, HiveTableMetaBuilder 
builder) throws SQLException {
    List<HiveTableMeta.HiveTableColumnMeta&gt; partitionColumns = 
Lists.newArrayList();
    if ("# Partition Information".equals(resultSet.getString(1).trim())) {
        resultSet.next();        Preconditions.checkArgument("# 
col_name".equals(resultSet.getString(1).trim()));
        resultSet.next();        // Error in validation here        
Preconditions.checkArgument("".equals(resultSet.getString(1).trim()));
        while (resultSet.next()) {
            if ("".equals(resultSet.getString(1).trim())) {
                break;
            }
            partitionColumns.add(new 
HiveTableMeta.HiveTableColumnMeta(resultSet.getString(1).trim(),
                    resultSet.getString(2).trim(), 
resultSet.getString(3).trim()));
        }
        builder.setPartitionColumns(partitionColumns);
    }
```
And this **ResultSet** in Source Code is:
```
String des = "describe formatted ";
ResultSet resultSet = stmt.executeQuery(des.concat(tableName));
``` 
However, I using Beeline connect to Hive. Execute query statement:
&gt; describe formatted my_table_name
(Cut off part of the content to show)


| # Partition Information         | NULL           | NULL          |
| # col_name                      | data_type      | comment       |
| my_field                        | string         |               |
|                                 | NULL           | NULL          |
| # Detailed Table Information    | NULL           | NULL          |




Let us look at the exception source code :
```
        resultSet.next();        Preconditions.checkArgument("# 
col_name".equals(resultSet.getString(1).trim()));        resultSet.next();      
  // Error in validation here        
Preconditions.checkArgument("".equals(resultSet.getString(1).trim()));
```


**resultSet.next()** whether is null? But I query result display:
| my_field                        | string         |               |


It then failed to load the table metadata information.
So whether this judgment is a judgment error or because of the different 
version of the problem.


Looking forward to reply.

Reply via email to