siddhi app.ddifudent定义中的错误与输出相同
我创建一个流以从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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
定义表时,定义应该是表定义
When you define a table, the definition should be a table definition so the correct way to define the
outputstream
is