Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions be/src/exec/broker_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ Status BrokerScanner::_convert_one_row(const Slice& line, Tuple* tuple, MemPool*
RETURN_IF_ERROR(_line_to_src_tuple(line));
if (!_success) {
// If not success, which means we met an invalid row, return.
*fill_tuple = false;
return Status::OK();
}

Expand Down
4 changes: 3 additions & 1 deletion be/test/olap/test_data/header_without_inc_rs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,7 @@
"lo": 10
},
"preferred_rowset_type": "BETA_ROWSET",
"tablet_type": "TABLET_TYPE_DISK"
"tablet_type": "TABLET_TYPE_DISK",
"storage_medium": "HDD",
"remote_storage_name": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;

import javax.annotation.Nullable;

public class Catalog {
Expand Down Expand Up @@ -4990,7 +4989,8 @@ public HashMap<Long, TStorageMedium> getPartitionIdToStorageMediumMap() {
if (dataProperty.getStorageMedium() == TStorageMedium.SSD
&& dataProperty.getCooldownTimeMs() < currentTimeMs) {
// expire. change to HDD.
partitionInfo.setDataProperty(partition.getId(), new DataProperty(TStorageMedium.HDD));
DataProperty hddProperty = new DataProperty(TStorageMedium.HDD);
partitionInfo.setDataProperty(partition.getId(), hddProperty);
storageMediumMap.put(partitionId, TStorageMedium.HDD);
LOG.debug("partition[{}-{}-{}] storage medium changed from SSD to HDD",
dbId, tableId, partitionId);
Expand All @@ -4999,7 +4999,7 @@ public HashMap<Long, TStorageMedium> getPartitionIdToStorageMediumMap() {
ModifyPartitionInfo info =
new ModifyPartitionInfo(db.getId(), olapTable.getId(),
partition.getId(),
DataProperty.DEFAULT_DATA_PROPERTY,
hddProperty,
ReplicaAllocation.NOT_SET,
partitionInfo.getIsInMemory(partition.getId()));
editLog.logModifyPartition(info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand Down Expand Up @@ -129,6 +128,9 @@ public Object query_plan(
// status code should conforms to HTTP semantic
resultMap.put("status", e.getCode().code());
resultMap.put("exception", e.getMessage());
} catch (Exception e) {
resultMap.put("status", "1");
resultMap.put("exception", e.getMessage());
}
return ResponseEntityBuilder.ok(resultMap);
}
Expand Down Expand Up @@ -252,7 +254,7 @@ private Map<String, Node> assemblePrunedPartitions(List<TScanRangeLocations> sca
for (TScanRangeLocations scanRangeLocations : scanRangeLocationsList) {
// only process palo(doris) scan range
TPaloScanRange scanRange = scanRangeLocations.scan_range.palo_scan_range;
Node tabletRouting = new Node(Long.parseLong(scanRange.version), Integer.parseInt(scanRange.schema_hash));
Node tabletRouting = new Node(Long.parseLong(scanRange.version), 0 /* schema hash is not used */);
for (TNetworkAddress address : scanRange.hosts) {
tabletRouting.addRouting(address.hostname + ":" + address.port);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import org.apache.doris.utframe.UtFrameUtils;

import org.junit.Assert;
import org.junit.Test;

import java.util.UUID;


public class ExplainTest {
Expand Down Expand Up @@ -75,20 +72,20 @@ public void after() throws Exception {
Assert.assertEquals(dropDbStmt.toSql(), dropSchemaStmt.toSql());
}

public void testExplainInsertInto() throws Exception {
String sql = "explain insert into test_explain.explain_t1 select * from test_explain.explain_t2";
String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);
System.out.println(explainString);
Assert.assertTrue(explainString.contains("CAST"));
}

public void testExplainSelect() throws Exception {
String sql = "explain select * from test_explain.explain_t1 where dt = '1001';";
String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, false);
System.out.println(explainString);
Assert.assertFalse(explainString.contains("CAST"));
}

public void testExplainInsertInto() throws Exception {
String sql = "explain verbose insert into test_explain.explain_t1 select * from test_explain.explain_t2";
String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, sql, true);
System.out.println(explainString);
Assert.assertTrue(explainString.contains("CAST"));
}

public void testExplainVerboseSelect() throws Exception {
String queryStr = "explain verbose select * from test_explain.explain_t1 where dt = '1001';";
String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(ctx, queryStr, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.doris.catalog;

import org.apache.doris.analysis.AlterViewStmt;
import org.apache.doris.analysis.CreateDbStmt;
import org.apache.doris.analysis.CreateTableStmt;
import org.apache.doris.analysis.CreateViewStmt;
Expand Down Expand Up @@ -129,4 +130,22 @@ public void testNestedViews() throws Exception {
System.out.println(explainString);
Assert.assertTrue(explainString.contains("OlapScanNode"));
}

@Test
public void testAlterView() throws Exception {
String originStmt = "select k1 as kc1, sum(k2) as kc2 from test.tbl1 group by kc1";
ExceptionChecker.expectThrowsNoException(
() -> createView("create view test.alter1 as " + originStmt));
Database db = Catalog.getCurrentCatalog().getDbOrDdlException("default_cluster:test");
View alter1 = (View) db.getTableOrDdlException("alter1");
Assert.assertEquals("SELECT `k1` AS `kc1`, sum(`k2`) AS `kc2` FROM `default_cluster:test`.`tbl1` GROUP BY `kc1`", alter1.getInlineViewDef());

String alterStmt = "alter view test.alter1 as with test1_cte (w1, w2) as (select k1, k2 from test.tbl1) select w1 as c1, sum(w2) as c2 from test1_cte where w1 > 10 group by w1 order by w1";
AlterViewStmt alterViewStmt = (AlterViewStmt) UtFrameUtils.parseAndAnalyzeStmt(alterStmt, connectContext);
Catalog.getCurrentCatalog().alterView(alterViewStmt);

alter1 = (View) db.getTableOrDdlException("alter1");
System.out.println(alter1.getInlineViewDef());
Assert.assertEquals("WITH test1_cte(w1, w2) AS (SELECT `k1` AS `k1`, `k2` AS `k2` FROM `default_cluster:test`.`tbl1`) SELECT `w1` AS `c1`, sum(`w2`) AS `c2` FROM `test1_cte` WHERE `w1` > 10 GROUP BY `w1` ORDER BY `w1` ASC", alter1.getInlineViewDef());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setUp() {
}
@Test
public void testQueryPlanAction() throws IOException, TException {
RequestBody body = RequestBody.create(JSON, "{ \"sql\" : \" select k1,k2 from " + DB_NAME + "." + TABLE_NAME + " \" }");
RequestBody body = RequestBody.create("{ \"sql\" : \" select k1,k2 from " + DB_NAME + "." + TABLE_NAME + " \" }", JSON);
Request request = new Request.Builder()
.post(body)
.addHeader("Authorization", rootAuth)
Expand All @@ -67,8 +67,6 @@ public void testQueryPlanAction() throws IOException, TException {
Assert.assertNotNull(tabletObject.get("routings"));
Assert.assertEquals(3, ((JSONArray) tabletObject.get("routings")).size());
Assert.assertEquals(testStartVersion, (long) tabletObject.get("version"));
Assert.assertEquals(testSchemaHash, (long) tabletObject.get("schemaHash"));

}
String queryPlan = (String) ((JSONObject) jsonObject.get("data")).get("opaqued_query_plan");
Assert.assertNotNull(queryPlan);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1991,8 +1991,8 @@ public void testGroupingSetOutOfBoundError() throws Exception {
public void testExplainInsertInto() throws Exception {
ExplainTest explainTest = new ExplainTest();
explainTest.before(connectContext);
explainTest.testExplainInsertInto();
explainTest.testExplainSelect();
explainTest.testExplainInsertInto();
explainTest.testExplainVerboseSelect();
explainTest.testExplainConcatSelect();
explainTest.testExplainVerboseConcatSelect();
Expand Down Expand Up @@ -2097,7 +2097,8 @@ public void testResultExprs() throws Exception {
" (SELECT 4 AS bid)b ON (a.aid=b.bid)\n";
String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, queryStr);
Assert.assertFalse(explainString.contains("OUTPUT EXPRS:3 | 4"));
Assert.assertTrue(explainString.contains("OUTPUT EXPRS:CAST(`a`.`aid` AS INT) | 4"));
System.out.println(explainString);
Assert.assertTrue(explainString.contains("OUTPUT EXPRS:`a`.`aid` | 4"));
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions regression-test/conf/regression-conf.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
// **Note**: default db will be create if not exist
defaultDb = "regression_test"

jdbcUrl = "jdbc:mysql://127.0.0.1:9030/?"
jdbcUrl = "jdbc:mysql://127.0.0.1:9232/?"
jdbcUser = "root"
jdbcPassword = ""

feHttpAddress = "127.0.0.1:8030"
feHttpAddress = "127.0.0.1:8232"
feHttpUser = "root"
feHttpPassword = ""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !select_tb --
1 2 4 8 50string 500varchar c 65535varchar 0.000000 123456789012345678.123456789 2013-12-01 1900-01-01T00:00 1 2 4 8 50string 500varchar_replace c 65535varchar 12345678901234.123456 123456789012345678.123456789 1900-01-01 1900-01-01 1900-01-01 1900-01-01T00:00 1900-01-01T00:00 1900-01-01T00:00 0.4 0.8
1 2 4 8 50string 500varchar c 65535varchar 0 123456789012345678.123456789 2013-12-01 1900-01-01T00:00 1 2 4 8 50string 500varchar_replace c 65535varchar 12345678901234.123456 123456789012345678.123456789 1900-01-01 1900-01-01 1900-01-01 1900-01-01T00:00 1900-01-01T00:00 1900-01-01T00:00 0.4 0.8

-- !desc_tb --
tinyint_key TINYINT No true \N
Expand Down
7 changes: 7 additions & 0 deletions regression-test/data/datatype/string/test_string_basic.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !select_str_tb --
\N \N \N
d41d8cd98f00b204e9800998ecf8427e 0
1 1f44fb91f47cab16f711973af06294a0 65536
2 3c514d3b89e26e2f983b7bd4cbb82055 1048576

Loading