jersy opened a new issue, #1944:
URL: https://github.com/apache/incubator-seatunnel/issues/1944

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   seatunnel config file do not use  include file do substitutions 
   
   ### SeaTunnel Version
   
   2.1.1
   
   ### SeaTunnel Config
   
   ```conf
   #source_sql_db.conf
   ems {
     driver = "com.mysql.jdbc.Driver"
     url = "jdbc:mysql://localhost:3306/ems"
     user = "ems"
     password = "emspass"
   }
   
   #spark_application4.conf
   
   driver="com.mysql.jdbc.Driver"
   refer_driver=${driver}
   
   include "source_sql_db.conf"
   
   source {
       jdbc {
         driver = ${ems.driver}
         url = ${ems.url}
         table =${ems.driver}
         user = ${ems.user}
         password = ${ems.password}
         result_table_name = "test_table"
       }
   }
   transform {
   }
   sink {
   }
   ```
   
   
   ### Running Command
   
   ```shell
   import org.apache.seatunnel.shade.com.typesafe.config.Config;
   import org.apache.seatunnel.shade.com.typesafe.config.ConfigFactory;
   import org.apache.seatunnel.shade.com.typesafe.config.ConfigRenderOptions;
   import org.apache.seatunnel.shade.com.typesafe.config.ConfigResolveOptions;
   
   import java.io.File;
   import java.io.FileNotFoundException;
   
   public class TestConfig4 {
       public static void main(String[] args) throws FileNotFoundException {
           String configFile = "config/spark_application4.conf";
           File file = new File(configFile);
           if (!file.exists()) {
               throw new FileNotFoundException("config file '" + file + "' does 
not exists!");
           }
   
           Config appConfig = ConfigFactory.parseFile(file)
                   
.resolve(ConfigResolveOptions.defaults().setAllowUnresolved(true))
                   .resolveWith( ConfigFactory.systemEnvironment(), 
ConfigResolveOptions.defaults().setAllowUnresolved(true));
   
           ConfigRenderOptions options = 
ConfigRenderOptions.concise().setFormatted(true);
           System.out.println(appConfig.root().render(options));;
       }
   }
   ```
   
   
   ### Error Exception
   
   ```log
   {
       "transform" : [],
       "driver" : "com.mysql.jdbc.Driver",
       "sink" : [],
       "ems" : {
           "driver" : "com.mysql.jdbc.Driver",
           "url" : "jdbc:mysql://localhost:3306/ems",
           "user" : "ems",
           "password" : "emspass"
       },
       "source" : [
           {
               "password" : ${ems.password},
               "driver" : ${ems.driver},
               "result_table_name" : "test_table",
               "plugin_name" : "jdbc",
               "user" : ${ems.user},
               "url" : ${ems.url},
               "table" : ${ems.driver}
           }
       ],
       "refer_driver" : "com.mysql.jdbc.Driver"
   }
   ```
   
   
   ### Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   1.8
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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