Aggarwal-Raghav commented on code in PR #6701:
URL: https://github.com/apache/hive/pull/6701#discussion_r3917436644


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/FileSinkOperator.java:
##########
@@ -640,6 +641,7 @@ protected void initializeOp(Configuration hconf) throws 
HiveException {
 
       jc = new JobConf(hconf);
       setWriteOperation(jc, getConf().getTableInfo().getTableName(), 
getConf().getWriteOperation());
+      setStatementOperation(jc, getConf().getTableInfo().getTableName(), 
getConf().getStatementOperation());

Review Comment:
   `ctx.getOperation()` and `queryState.getHiveOperation()` will not match 
because for MERGE, Update or SELECT `queryState.getHiveOperation()` will return 
`HiveOperation.QUERY`. 
   
   `queryState.getHiveOperation()` is used extensively in LineageLogger (I've 
worked on that previously).
   
   To test it I added this in `SemanticAnalyzer#createFileSinkDesc()` and 
re-ran the `iceberg_mixed_write_modes.q` file
   ```java
   LOG.info("TESTING_OPERATIONS: ctx.getOperation() = " + ctx.getOperation() + 
", queryState.getHiveOperation() = " + queryState.getHiveOperation());
   ```
   Output:
   <img width="1420" height="409" alt="Screenshot 2026-09-03 at 12 07 05 AM" 
src="https://github.com/user-attachments/assets/2760e361-db36-48b0-bcb9-da231266df4b";
 />
   



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