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

   ### Search before asking
   
   - [x] Searched open and closed issues and PRs for this metadata/literal-key 
path; no matching fix found. This is a follow-up to the out-of-scope metadata 
conversions discussed in #12443.
   
   ### What happened
   
   `MetadataProviderManager.resolveDataSourceConfigs()` rejects an otherwise 
valid quoted schema key when metadata resolution is enabled, even if no 
connector has a `metadata_datasource_id`. It unwraps the config and passes the 
resulting map to an unguarded `ConfigFactory.parseMap(resultMap)`, which 
interprets the literal key as a path again.
   
   I reproduced this through the real public method with a fake provider 
injected using the existing `MetadataProviderManagerTest` cache-registration 
pattern. The fake provider was never asked for a datasource and was closed 
after the probe. This is an API-level reproduction; no external metadata 
service or engine job was run.
   
   The controls distinguish it from provider setup or an invalid input:
   
   | Metadata enabled | Schema field | Result |
   | --- | --- | --- |
   | false | `^t_nova_.*$` | Pass; key preserved |
   | true | `table` | Pass; key preserved |
   | true | `^t_nova_.*$` | `ConfigException.BadPath` |
   
   Expected: enabling metadata resolution should not change a schema key when 
there is no datasource configuration to merge.
   
   ### SeaTunnel Version
   
   dev `1ce2d7815665`; also reproduced on its integration with #12443. 
`MetadataProviderManager` is unchanged by that PR.
   
   ### SeaTunnel Config
   
   ```hocon
   env { job.mode = BATCH }
   source {
     FakeSource {
       schema { fields { "^t_nova_.*$" = "string" } }
     }
   }
   sink { Console {} }
   ```
   
   The probe builds a `MetadataConfig` with `enabled=true`, an initialized fake 
provider kind and empty properties, then calls 
`resolveDataSourceConfigs(jobConfig, metadataConfig)`. Using `enabled=false`, 
or replacing the quoted field with `table`, gives the passing controls above.
   
   ### Running Command
   
   The standalone Java probe ran on the successful `seatunnel-api` Maven test 
classpath with Microsoft OpenJDK 17.0.18. The relevant public call is:
   
   ```java
   MetadataProviderManager.resolveDataSourceConfigs(jobConfig, metadataConfig);
   ```
   
   ### Error Exception
   
   ```text
   org.apache.seatunnel.shade.com.typesafe.config.ConfigException$BadPath:
   path parameter: Invalid path '^t_nova_.*$': Token not allowed in path 
expression:
   'end of file' ('$' not followed by {, 'end of file' not allowed after '$')
   ```
   
   The final re-parse is at 
`seatunnel-api/.../metadata/MetadataProviderManager.java:106`; `mergeConfig()` 
has another unguarded map re-parse at line 346 that should be checked in the 
same follow-up. No fix for either site is included in #12443.
   
   ### Java or Scala Version
   
   Microsoft OpenJDK 17.0.18. Engine integration was not exercised in this 
probe.
   
   ### Are you willing to submit PR?
   
   - [x] Yes, after confirming the separate follow-up scope and checking 
concurrent work.
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of 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