You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import apache_beam as beam
import pandas as pd
from psycopg.rows import dict_row
from datetime import datetime
import pandas as pd
from beam_postgres.io import ReadAllFromPostgres
with beam.Pipeline() as p:
print(datetime.now())
data = p | "Reading example records from database" >> ReadAllFromPostgres(
"host=host dbname=db user=user password=passowrd",
'SELECT _id FROM "62a9c0ec85354b161b80df98" LIMIT 10000000',
dict_row,
)
data | "Writing to stdout" >> beam.Map(print)
print(datetime.now())
From the above code i am getting ouput in the {"key": "value"} pair but i dont know how to convert to a Dataframe. Can someone help me with this.
The text was updated successfully, but these errors were encountered:
import apache_beam as beam
import pandas as pd
from psycopg.rows import dict_row
from datetime import datetime
import pandas as pd
from beam_postgres.io import ReadAllFromPostgres
with beam.Pipeline() as p:
print(datetime.now())
data = p | "Reading example records from database" >> ReadAllFromPostgres(
"host=host dbname=db user=user password=passowrd",
'SELECT _id FROM "62a9c0ec85354b161b80df98" LIMIT 10000000',
dict_row,
)
data | "Writing to stdout" >> beam.Map(print)
print(datetime.now())
From the above code i am getting ouput in the {"key": "value"} pair but i dont know how to convert to a Dataframe. Can someone help me with this.
The text was updated successfully, but these errors were encountered: