Zouxxyy opened a new issue, #8312:
URL: https://github.com/apache/hudi/issues/8312
**Describe the problem you faced**
When scan partitioned hudi mor table (without ro/rt suffix), we get nothing,
because metadata (especially partitions) is not synchronized to HMS. As follows
```java
protected void doSync() {
switch (syncClient.getTableType()) {
case COPY_ON_WRITE:
syncHoodieTable(snapshotTableName, false, false);
break;
case MERGE_ON_READ:
switch (HoodieSyncTableStrategy.valueOf(hiveSyncTableStrategy)) {
case RO :
// sync a RO table for MOR
syncHoodieTable(tableName, false, true);
break;
case RT :
// sync a RT table for MOR
syncHoodieTable(tableName, true, false);
break;
default:
// sync a RO table for MOR
syncHoodieTable(roTableName.get(), false, true);
// sync a RT table for MOR
syncHoodieTable(snapshotTableName, true, false);
}
break;
default:
LOG.error("Unknown table type " + syncClient.getTableType());
throw new InvalidTableException(syncClient.getBasePath());
}
}
```
In addition, there is a parameter,
`hoodie.datasource.hive_sync.skip_ro_suffix`, when set it to true, **will
register table without ro suffix as ro table**;
**This contradicts spark's behavior**, because the behavior of querying
table without suffix is **actually rt table**.
**To Reproduce**
Steps to reproduce the behavior:
```sql
-- spark
create table hudi_mor_test_tbl (
id bigint,
name string,
ts bigint,
dt string,
hh string
) using hudi
tblproperties (
type = 'mor',
primaryKey = 'id',
preCombineField = 'ts'
)
partitioned by (dt, hh);
insert into hudi_mor_test_tbl values (1, 'a1', 1001, '2021-12-09', '10');
-- hive
select * from hudi_mor_test_tbl;
```
**Expected behavior**
We should get query result
**Environment Description**
* Hudi version : 0.13.0
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]