Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
BowenXiao1999 committed Sep 6, 2022
1 parent 42aec1d commit 3929d64
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
10 changes: 1 addition & 9 deletions src/frontend/src/handler/dml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use futures::StreamExt;
use futures_async_stream::for_await;
use pgwire::pg_response::{PgResponse, StatementType};
use risingwave_common::error::{internal_err, Result};
use risingwave_common::error::Result;
use risingwave_sqlparser::ast::Statement;
use tokio::sync::oneshot;

Expand Down Expand Up @@ -50,13 +49,6 @@ pub async fn handle_dml(context: OptimizerContext, stmt: Statement) -> Result<Pg
rows.extend(to_pg_rows(chunk?, false));
}

// // FIXME: Due to #4947, return early if chunk's empty (must be execution failure).
// if rows.is_empty() {
// return Err(internal_err(anyhow!(
// "DML execution fail, returned data chunk is empty"
// )));
// }

// Check whether error happen, if yes, returned.
let execution_ret = data_stream.take_result();
if let Some(ret) = execution_ret {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/optimizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use self::property::RequiredDist;
use self::rule::*;
use crate::catalog::TableId;
use crate::optimizer::plan_node::{BatchExchange, PlanNodeType};
use crate::optimizer::plan_visitor::{PlanVisitor, has_batch_exchange, has_logical_apply};
use crate::optimizer::plan_visitor::{has_batch_exchange, has_logical_apply};
use crate::optimizer::property::Distribution;
use crate::utils::Condition;

Expand Down
18 changes: 10 additions & 8 deletions src/frontend/test_runner/tests/testdata/index_selection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@
create index idx3 on t1(c);
delete from t1 where b = 2;
batch_plan: |
BatchDelete { table: t1 }
BatchExchange { order: [], dist: Single }
BatchLookupJoin { type: Inner, predicate: idx2.t1._row_id IS NOT DISTINCT FROM t1._row_id, output: [t1.a, t1.b, t1.c, t1._row_id] }
BatchScan { table: idx2, columns: [idx2.t1._row_id], scan_ranges: [idx2.b = Decimal(Normalized(2))], distribution: SomeShard }
BatchExchange { order: [], dist: Single }
BatchDelete { table: t1 }
BatchExchange { order: [], dist: Single }
BatchLookupJoin { type: Inner, predicate: idx2.t1._row_id IS NOT DISTINCT FROM t1._row_id, output: [t1.a, t1.b, t1.c, t1._row_id] }
BatchScan { table: idx2, columns: [idx2.t1._row_id], scan_ranges: [idx2.b = Decimal(Normalized(2))], distribution: SomeShard }
batch_local_plan: |
BatchDelete { table: t1 }
BatchLookupJoin { type: Inner, predicate: idx2.t1._row_id IS NOT DISTINCT FROM t1._row_id, output: [t1.a, t1.b, t1.c, t1._row_id] }
Expand All @@ -197,10 +198,11 @@
create index idx3 on t1(c);
update t1 set c = 3 where a = 1 and b = 2;
batch_plan: |
BatchUpdate { table: t1, exprs: [$0, $1, 3:Int32::Int64, $3] }
BatchExchange { order: [], dist: Single }
BatchLookupJoin { type: Inner, predicate: idx2.t1._row_id IS NOT DISTINCT FROM t1._row_id, output: [t1.a, t1.b, t1.c, t1._row_id] }
BatchScan { table: idx2, columns: [idx2.t1._row_id], scan_ranges: [idx2.b = Decimal(Normalized(2)), idx2.a = Int32(1)], distribution: SomeShard }
BatchExchange { order: [], dist: Single }
BatchUpdate { table: t1, exprs: [$0, $1, 3:Int32::Int64, $3] }
BatchExchange { order: [], dist: Single }
BatchLookupJoin { type: Inner, predicate: idx2.t1._row_id IS NOT DISTINCT FROM t1._row_id, output: [t1.a, t1.b, t1.c, t1._row_id] }
BatchScan { table: idx2, columns: [idx2.t1._row_id], scan_ranges: [idx2.b = Decimal(Normalized(2)), idx2.a = Int32(1)], distribution: SomeShard }
batch_local_plan: |
BatchUpdate { table: t1, exprs: [$0, $1, 3:Int32::Int64, $3] }
BatchLookupJoin { type: Inner, predicate: idx2.t1._row_id IS NOT DISTINCT FROM t1._row_id, output: [t1.a, t1.b, t1.c, t1._row_id] }
Expand Down

0 comments on commit 3929d64

Please sign in to comment.