|
|
@@ -175,6 +175,34 @@ describe("autocomplete.js", function() {
|
|
|
expectedSuggestions: ["testTable1", "testTable2"]
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ it("should suggest aliases", function() {
|
|
|
+ assertAutoComplete({
|
|
|
+ serverResponses: {},
|
|
|
+ beforeCursor: "SELECT ",
|
|
|
+ afterCursor: " FROM testTableA tta, testTableB",
|
|
|
+ expectedSuggestions: ["testTableB.", "tta."]
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ it("should only suggest table aliases", function() {
|
|
|
+ assertAutoComplete({
|
|
|
+ serverResponses: {},
|
|
|
+ beforeCursor: "SELECT ",
|
|
|
+ afterCursor: " FROM testTableA tta, (SELECT SUM(A*B) total FROM tta.array) ttaSum, testTableB ttb",
|
|
|
+ expectedSuggestions: ["tta.", "ttb."]
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // TODO: Fix me...
|
|
|
+ xit("should suggest aliases from nested selects", function() {
|
|
|
+ assertAutoComplete({
|
|
|
+ serverResponses: {},
|
|
|
+ beforeCursor: "SELECT ",
|
|
|
+ afterCursor: " FROM testTableA tta, testTableB ttb, (SELECT SUM(A*B) total FROM tta.array) ttaSum",
|
|
|
+ expectedSuggestions: ["tta.", "ttb.", "ttaSum."]
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
describe("hive-specific stuff", function() {
|
|
|
@@ -714,15 +742,6 @@ describe("autocomplete.js", function() {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- it("should suggest aliases", function() {
|
|
|
- assertAutoComplete({
|
|
|
- serverResponses: {},
|
|
|
- beforeCursor: "SELECT ",
|
|
|
- afterCursor: " FROM testTableA tta, testTableB",
|
|
|
- expectedSuggestions: ["testTableB.", "tta."]
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
describe("struct completion", function() {
|
|
|
it("should suggest fields from columns that are structs", function() {
|
|
|
assertAutoComplete({
|