thomasrebele commented on code in PR #6825:
URL: https://github.com/apache/hive/pull/6825#discussion_r4216822194


##########
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/PostgresTPCDS.java:
##########
@@ -57,6 +70,12 @@ public void install() {
     String hiveSchemaVer = MetaStoreSchemaInfoFactory.get(new 
Configuration()).getHiveSchemaVersion();
     try (InputStream script = PostgresTPCDS.class.getClassLoader()
         .getResourceAsStream("sql/postgres/upgrade-3.1.3000-to-" + 
hiveSchemaVer + ".postgres.sql")) {
+      // The dump was created from a metastore where some columns had the 
wrong types.
+      // Fix those that some tests verify.
+      String fixColumnTypes =
+          "UPDATE \"COLUMNS_V2\" c SET \"TYPE_NAME\" = 'char(16)' WHERE 
\"COLUMN_NAME\" in ('c_customer_id', 'ca_address_id')" + "AND EXISTS (SELECT * 
FROM \"SDS\" s WHERE s.\"CD_ID\" = c.\"CD_ID\");\n";
+      InputStream script2 =
+          new SequenceInputStream(new 
ByteArrayInputStream(fixColumnTypes.getBytes(StandardCharsets.UTF_8)), script);

Review Comment:
   I didn't want to put the statement into the file, as its name indicated a 
more general use. I guess the file is not used anywhere else. How about 
renaming the file to `migrate-metastore-dump-to-...postgres.sql`?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to