Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Oct 10, 2024
1 parent 4674982 commit fe10528
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e_test/source/tvf/postgres_query.slt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CREATE TABLE test (

system ok
PGHOST=db PGPORT=5432 PGUSER=postgres PGPASSWORD=postgres PGDATABASE=cdc_test psql -c "
INSERT INTO test SELECT generate_series(1, 100), true, 1, 1, 1, 1.0, 1.0, 1.0, '2021-01-01', '00:00:00', '2021-01-01 00:00:00', '2021-01-01 00:00:00+02', 'text', 'varchar', '1 day', '{}', '\\x01';
INSERT INTO test SELECT generate_series(1, 100), true, 1, 1, 1, 1.0, 1.0, 1.0, '2021-01-01', '00:00:00', '2021-01-01 00:00:00', '2021-01-01 00:00:00+02', 'text', 'varchar', '1 day', '{}', '\x01';
"

query II
Expand Down
6 changes: 5 additions & 1 deletion src/batch/src/executor/postgres_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::Context;
use futures_async_stream::try_stream;
use futures_util::stream::StreamExt;
use risingwave_common::catalog::{Field, Schema};
Expand Down Expand Up @@ -146,7 +147,10 @@ impl PostgresQueryExecutor {
});

// TODO(kwannoel): Use pagination using CURSOR.
let rows = client.query(&self.query, &[]).await.context("postgres_query received error from remote server")?;
let rows = client
.query(&self.query, &[])
.await
.context("postgres_query received error from remote server")?;
let mut builder = DataChunkBuilder::new(self.schema.data_types(), 1024);
tracing::debug!("postgres_query_executor: query executed, start deserializing rows");
// deserialize the rows
Expand Down

0 comments on commit fe10528

Please sign in to comment.