siddhi app.ddifudent定义中的错误与输出相同

发布于 2025-01-22 05:23:08 字数 742 浏览 1 评论 0原文

我创建一个流以从CSV读取数据并将其写入PostgreSQL中,它可以完成所有操作,只需在DB上插入数据: 我的CSV包括1,测试,1 我的流:

@App:name("StockFile")

@App:description('test ...')

@source(type='file',
dir.uri='file:C:\file',
action.after.process='NONE',
@map(type='csv'))
define stream IntputStream (Amount int, Location string,  ProductId int);

@store(type = 'rdbms',
jdbc.url = "jdbc:postgresql://localhost:5432/postgres",
username = "xxx",
password = "xxx",
jdbc.driver.name = "org.postgresql.Driver",
table.name = 'Test',
operation = 'insert', 
@map(type = 'keyvalue' ))
define stream outputstream (Amount int, Location string,  ProductId int);

@info(name = 'Save stock records')
from IntputStream 
select Amount,Location,ProductId
insert into outputstream;

I create a stream to read data from csv and write it in Postgresql it do everything just insert data on db:
my csv consist of 1,test,1
my stream :

@App:name("StockFile")

@App:description('test ...')

@source(type='file',
dir.uri='file:C:\file',
action.after.process='NONE',
@map(type='csv'))
define stream IntputStream (Amount int, Location string,  ProductId int);

@store(type = 'rdbms',
jdbc.url = "jdbc:postgresql://localhost:5432/postgres",
username = "xxx",
password = "xxx",
jdbc.driver.name = "org.postgresql.Driver",
table.name = 'Test',
operation = 'insert', 
@map(type = 'keyvalue' ))
define stream outputstream (Amount int, Location string,  ProductId int);

@info(name = 'Save stock records')
from IntputStream 
select Amount,Location,ProductId
insert into outputstream;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌上青苔 2025-01-29 05:23:08

定义表时,定义应该是表定义

@store(type = 'rdbms',jdbc.url = "jdbc:postgresql://localhost:5432/postgres",username = "xxx",password = "xxx",jdbc.driver.name = "org.postgresql.Driver",table.name = 'Test',operation = 'insert', @map(type = 'keyvalue' ))
define table outputstream (Amount int, Location string,  ProductId int);

When you define a table, the definition should be a table definition so the correct way to define the outputstream is

@store(type = 'rdbms',jdbc.url = "jdbc:postgresql://localhost:5432/postgres",username = "xxx",password = "xxx",jdbc.driver.name = "org.postgresql.Driver",table.name = 'Test',operation = 'insert', @map(type = 'keyvalue' ))
define table outputstream (Amount int, Location string,  ProductId int);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文