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

stream读取csv后,csv内容变更后,print出来的内容没有更新 #9

Closed
Emmitte opened this issue Dec 3, 2019 · 2 comments

Comments

@Emmitte
Copy link

Emmitte commented Dec 3, 2019

大神们好,我有个问题,用CsvSourceStreamOp方法读取csv后,csv内容变更后,print出来的内容没有更新。以下是我的代码,请大神帮忙解决一下,谢谢!
`#!/usr/bin/python

-- coding: UTF-8 --

from pyalink.alink import *
import numpy as np
import pandas as pd

useLocalEnv(1)

schemaStr = "A double, B double, C double, D double, label string"
path = "D:/program/Alink_script/data/iris2_1_stream.csv"
csvSource = CsvSourceStreamOp().setFilePath(path).setSchemaStr(schemaStr).setFieldDelimiter(",")
csvSource.print()
sample = SampleStreamOp().setRatio(0.01).linkFrom(csvSource)
sample.print(key="csvSource", refreshInterval=1)
StreamOperator.execute()`

@chengscu
Copy link
Collaborator

chengscu commented Dec 3, 2019

大神们好,我有个问题,用CsvSourceStreamOp方法读取csv后,csv内容变更后,print出来的内容没有更新。以下是我的代码,请大神帮忙解决一下,谢谢!
`#!/usr/bin/python

-- coding: UTF-8 --

from pyalink.alink import *
import numpy as np
import pandas as pd

useLocalEnv(1)

schemaStr = "A double, B double, C double, D double, label string"
path = "D:/program/Alink_script/data/iris2_1_stream.csv"
csvSource = CsvSourceStreamOp().setFilePath(path).setSchemaStr(schemaStr).setFieldDelimiter(",")
csvSource.print()
sample = SampleStreamOp().setRatio(0.01).linkFrom(csvSource)
sample.print(key="csvSource", refreshInterval=1)
StreamOperator.execute()`

你好,CSV不会读取新的内容。针对您的这个场景,建议使用消息队列,例如kafka。

@Emmitte
Copy link
Author

Emmitte commented Dec 3, 2019 via email

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

3 participants