Gabriel39 commented on code in PR #65446:
URL: https://github.com/apache/doris/pull/65446#discussion_r3567948737


##########
fe/fe-core/src/test/java/org/apache/doris/datasource/hive/source/HiveScanNodeTest.java:
##########
@@ -97,6 +98,23 @@ public void 
testSelectedPartitionsCarryPartitionPredicateFlag() {
         Assert.assertTrue(selectedPartitions.hasPartitionPredicate);
     }
 
+    @Test
+    public void testHiveParquetTimeZoneComesFromCatalogInsteadOfSession() 
throws Exception {
+        SessionVariable sv = new SessionVariable();
+        TupleDescriptor desc = new TupleDescriptor(new TupleId(0));
+        HMSExternalTable table = Mockito.mock(HMSExternalTable.class);
+        HMSExternalCatalog catalog = Mockito.mock(HMSExternalCatalog.class);
+        Mockito.when(table.getCatalog()).thenReturn(catalog);
+        Mockito.when(catalog.bindBrokerName()).thenReturn("");
+        
Mockito.when(catalog.getHiveParquetTimeZone()).thenReturn("Asia/Shanghai");
+        desc.setTable(table);
+        HiveScanNode node = new HiveScanNode(new PlanNodeId(0), desc, false, 
sv, null, ScanContext.EMPTY);
+
+        Method method = 
FileQueryScanNode.class.getDeclaredMethod("getHiveParquetTimeZone");
+        method.setAccessible(true);
+        Assert.assertEquals("Asia/Shanghai", method.invoke(node));

Review Comment:
   Fixed in 79a3057424a. The test now mocks , so it exercises the guarded Hive 
catalog timezone path.



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