shashwatsai opened a new issue, #7807:
URL: https://github.com/apache/seatunnel/issues/7807

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   While working on contributing to seatunnel-web HDFS datasource interface, as 
per HdfsFileSourceFactory#OptionRule we should allow users to provide user 
defined schema for TEXT, CSV, JSON, EXCEL and XML, during dynamic form 
generation, only for file_format_type TEXT, we are able to provide the schema. 
   
   Reason: 
   for conditional options which have an expression with multiple conditions 
like `file_format_type==TEXT || file_format_type==CSV`, during form generation, 
only the first expression is parsed. 
   
   ```
   .conditional(
       BaseSourceConfigOptions.FILE_FORMAT_TYPE,
       Arrays.asList(
               FileFormat.TEXT,
               FileFormat.JSON,
               FileFormat.EXCEL,
               FileFormat.CSV,
               FileFormat.XML),
       TableSchemaOptions.SCHEMA)
   ```    
   
   This issue was observed while working on 
https://github.com/apache/seatunnel/issues/7767
   
   ### SeaTunnel Version
   
   **seatunnel**: 2.3.7
   **seatunnel-web**: 1.0.1
   
   ### SeaTunnel Config
   
   ```conf
   Issue during generation of seatunnel config for HDFS.
   ```
   
   
   ### Running Command
   
   ```shell
   1. Navigate to seatunnel-web deployment.
   2. Try choose HdfsFile as source or sink.
   3. choose a file_format_type, only for TEXT, the schema field gets rendered.
   ```
   
   
   ### Error Exception
   
   ```log
   Unable to select schema for file format types other than TEXT
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   schema field, actual:
   Screen Grab:
   <img width="424" alt="image" 
src="https://github.com/user-attachments/assets/63f2e19e-0992-4e63-854d-3d742ed2665e";>
   
   Rendered:
   For Text: 
   <img width="596" alt="image" 
src="https://github.com/user-attachments/assets/f4039c88-9b6f-4d99-a103-3d306b35cf82";>
   
   For CSV: No Schema field to provide input.
   <img width="482" alt="image" 
src="https://github.com/user-attachments/assets/db1d55c7-0c2f-49c8-b175-d2e0d4142288";>
   
   
   schema field expected:
   Screen Grab: 
   <img width="394" alt="image" 
src="https://github.com/user-attachments/assets/e4dac595-b23e-4338-a250-4623c5c7d120";>
   Expected: (For CSV as well we should see Schema field)
   <img width="604" alt="image" 
src="https://github.com/user-attachments/assets/ae21af69-26c5-4709-a946-3b429da4e327";>
   
   
   
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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

Reply via email to