Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seatunnel 2.3.8有没有可以通过restapi执行hocon格式文件的方式 #8563

Closed
soy-beanmilk opened this issue Jan 21, 2025 · 6 comments

Comments

@soy-beanmilk
Copy link

seatunnel 2.3.8有没有可以通过restapi执行hocon格式文件的方式

@fcb-xiaobo
Copy link
Contributor

fcb-xiaobo commented Jan 21, 2025

Version 2.3.9 has a method of submitting tasks by uploading files through the REST API. You can refer to it below
https://seatunnel.apache.org/docs/2.3.9/seatunnel-engine/rest-api-v2
interface -> /submit-job/upload

@soy-beanmilk
Copy link
Author

但是我们暂时还不能升级seatunnel版本,目前有没有hacon转json格式详细说明,或者相关工具。

@fcb-xiaobo
Copy link
Contributor

In 2.3.8, do you want to submit a hocon format configuration file through the REST API to submit the task, or do you want to convert the hocon configuration to JSON configuration through the REST API

@soy-beanmilk
Copy link
Author

最好的方式是restapi能够支持hocon格式,如果支持不了的话,能不能提供hacon格式转换为json格式的工具,或者文档说明,因为我发现官方文档对于json格式这块描述的不是很多。我尝试用一些工具直接将hacon格式转换为json,发现是行不通的,因为有一些字段差异。

@fcb-xiaobo
Copy link
Contributor

fcb-xiaobo commented Jan 21, 2025

At present, in 2.3.8, I understand that it is not possible to submit task configurations in hocon format through the rest API, nor can JSON configurations be converted to hocon configurations. If you want to convert them yourself, I have come up with a method using seatunnel and verified it,
config = ConfigFactory.parseString(”you hocon file“);
The content is your local hocon file and needs to be converted to a string

origin local hocon file

Image

use parseStirng convert after

Image

You can try it, I hope it can help you

@liunaijie
Copy link
Member

最好的方式是restapi能够支持hocon格式,如果支持不了的话,能不能提供hacon格式转换为json格式的工具,或者文档说明,因为我发现官方文档对于json格式这块描述的不是很多。我尝试用一些工具直接将hacon格式转换为json,发现是行不通的,因为有一些字段差异。

Hi, the sample code about convert hacon to json is :

public static final ConfigRenderOptions CONFIG_RENDER_OPTIONS = ConfigRenderOptions.concise().setFormatted(true);
Config config =  ConfigFactory.parseFile(filePath.toFile()).resolve(ConfigResolveOptions.defaults().setAllowUnresolved(true));
log.info(config.root().render(CONFIG_RENDER_OPTIONS))

You need import seatunnel-config-shade:2.3.9 (You need use 2.3.9, 2.3.9 has some fix.)

@hailin0 hailin0 closed this as completed Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants