MCPcopy Create free account
hub / github.com/apache/impala / TEST_F

Function TEST_F

be/src/service/impala-http-handler-test.cc:730–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728} // namespace impala
729
730TEST_F(ImpalaHttpHandlerTest, SelectStatement) {
731 const vector<string> SELECT_LABELS = {"01:EXCHANGE", "00:SCAN HDFS"};
732 const vector<string> SELECT_LABEL_DETAILS = {"UNPARTITIONED", "default.table"};
733 vector<TPlanFragment> fragments;
734 TExecSummary summary;
735
736 prepareSelectStatement(SELECT_LABELS, SELECT_LABEL_DETAILS, &fragments, &summary);
737
738 Document document;
739 Value value(kObjectType);
740
741 PlanToJson(fragments, summary, &document, &value);
742 document.CopyFrom(value, document.GetAllocator());
743
744 validatePlanSchema(document);
745
746 // Check the two nodes in the plan
747 auto array = document["plan_nodes"].GetArray();
748 ASSERT_EQ(array.Size(), 2);
749 for (size_t i = 0; i < array.Size(); ++i) {
750 EXPECT_EQ(array[i]["label"].GetString(), SELECT_LABELS.at(i));
751 EXPECT_EQ(array[i]["label_detail"].GetString(), SELECT_LABEL_DETAILS.at(i));
752
753 checkPlanNodeStats(array[i], i);
754
755 EXPECT_EQ(array[i]["children"].Size(), 0);
756 }
757
758 // The data_stream_target of 00:SCAN HDFS should point to the 01:EXCHANGE node
759 ASSERT_TRUE(array[1].HasMember("data_stream_target"));
760 EXPECT_EQ(array[1]["data_stream_target"].GetString(), SELECT_LABELS[0]);
761}
762
763TEST_F(ImpalaHttpHandlerTest, CreateTableAsSelectStatement) {
764 const vector<string> CTAS_LABELS = {"01:EXCHANGE", "00:SCAN HDFS"};

Callers

nothing calls this directly

Calls 8

prepareSelectStatementFunction · 0.85
prepareJoinStatementFunction · 0.85
prepareUpdateStatementFunction · 0.85
prepareMergeStatementFunction · 0.85
CopyFromMethod · 0.45
SizeMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected