Modify insert operation's behavior (#1444)
Before changing default insert operation to streaming load, if the select result of a insert stmt is empty, a label will still be returned to the user, and user can use this label to check the insert load job's status. After changing the insert operation, if the select result is empty, a exception will be thrown to user client directly without any label. This new usage pattern is not friendly to already existed users, which is forcing them to change their way of using insert operation. So I add a new FE config 'using_old_load_usage_pattern', default is false. If set to true, a label will be returned to user even if the select result is empty.
This commit is contained in:
@ -38,7 +38,7 @@ public class InsertLoadJobTest {
|
||||
public void testGetTableNames(@Mocked Catalog catalog,
|
||||
@Injectable Database database,
|
||||
@Injectable Table table) throws MetaNotFoundException {
|
||||
InsertLoadJob insertLoadJob = new InsertLoadJob("label", 1L, 1L, 1000);
|
||||
InsertLoadJob insertLoadJob = new InsertLoadJob("label", 1L, 1L, 1000, "");
|
||||
String tableName = "table1";
|
||||
new Expectations() {
|
||||
{
|
||||
|
||||
@ -17,11 +17,6 @@
|
||||
|
||||
package org.apache.doris.load.loadv2;
|
||||
|
||||
import mockit.Deencapsulation;
|
||||
import mockit.Expectations;
|
||||
import mockit.Injectable;
|
||||
import mockit.Mocked;
|
||||
|
||||
import org.apache.doris.analysis.LabelName;
|
||||
import org.apache.doris.analysis.LoadStmt;
|
||||
import org.apache.doris.catalog.Catalog;
|
||||
@ -48,6 +43,11 @@ import java.io.FileOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import mockit.Deencapsulation;
|
||||
import mockit.Expectations;
|
||||
import mockit.Injectable;
|
||||
import mockit.Mocked;
|
||||
|
||||
public class LoadManagerTest {
|
||||
private LoadManager loadManager;
|
||||
private static final String methodName = "getIdToLoadJobs";
|
||||
@ -55,7 +55,7 @@ public class LoadManagerTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
loadManager = new LoadManager(new LoadJobScheduler());
|
||||
LoadJob job1 = new InsertLoadJob("job1", 1L, 1L, System.currentTimeMillis());
|
||||
LoadJob job1 = new InsertLoadJob("job1", 1L, 1L, System.currentTimeMillis(), "");
|
||||
Deencapsulation.invoke(loadManager, "addLoadJob", job1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user