Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](hive catalog)When using the hive catalog the hive table name is uppercase, the Doris query is reported wrong #29058 #29059

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.


package org.apache.doris.datasource.hive.event;

import org.apache.doris.catalog.Env;
Expand All @@ -29,6 +28,7 @@

import java.security.SecureRandom;
import java.util.List;
import java.util.Locale;

/**
* MetastoreEvent for ALTER_TABLE event type
Expand Down Expand Up @@ -65,6 +65,7 @@ private AlterTableEvent(NotificationEvent event, String catalogName) {
(JSONAlterTableMessage) MetastoreEventsProcessor.getMessageDeserializer(event.getMessageFormat())
.getAlterTableMessage(event.getMessage());
tableAfter = Preconditions.checkNotNull(alterTableMessage.getTableObjAfter());
tableAfter.setTableName(tableAfter.getTableName().toLowerCase(Locale.ROOT));
tableBefore = Preconditions.checkNotNull(alterTableMessage.getTableObjBefore());
tblNameAfter = tableAfter.getTableName();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.


package org.apache.doris.datasource.hive.event;

import org.apache.doris.catalog.Env;
Expand All @@ -28,6 +27,7 @@
import org.apache.hadoop.hive.metastore.messaging.CreateTableMessage;

import java.util.List;
import java.util.Locale;

/**
* MetastoreEvent for CREATE_TABLE event type
Expand All @@ -51,6 +51,7 @@ private CreateTableEvent(NotificationEvent event, String catalogName) throws Met
MetastoreEventsProcessor.getMessageDeserializer(event.getMessageFormat())
.getCreateTableMessage(event.getMessage());
hmsTbl = Preconditions.checkNotNull(createTableMessage.getTableObj());
hmsTbl.setTableName(hmsTbl.getTableName().toLowerCase(Locale.ROOT));
} catch (Exception e) {
throw new MetastoreNotificationException(
debugString("Unable to deserialize the event message"), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.


package org.apache.doris.datasource.hive.event;

import org.apache.doris.datasource.hive.HMSCachedClient;
Expand All @@ -25,6 +24,7 @@
import org.apache.logging.log4j.Logger;

import java.util.List;
import java.util.Locale;
import java.util.Map;

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ protected MetastoreEvent(long eventId, String catalogName, String dbName,

protected MetastoreEvent(NotificationEvent event, String catalogName) {
this.event = event;
this.dbName = event.getDbName();
this.dbName = event.getDbName().toLowerCase(Locale.ROOT);
this.tblName = event.getTableName();
this.eventId = event.getEventId();
this.eventTime = event.getEventTime() * 1000L;
Expand Down
Loading