>From Janhavi Tripurwar <[email protected]>:

Janhavi Tripurwar has uploaded this change for review. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21667?usp=email )


Change subject: [ASTERIXDB-3593]: Remove Kind from the response
......................................................................

[ASTERIXDB-3593]: Remove Kind from the response

Change-Id: I777beaeafcde3acef25022e2211dbe2a6aa18350
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/NcStatementsPrinter.java
M 
asterixdb/asterix-app/src/test/java/org/apache/asterix/app/result/NcStatementsPrinterTest.java
2 files changed, 1 insertion(+), 22 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/67/21667/1

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/NcStatementsPrinter.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/NcStatementsPrinter.java
index 5b194a4..68b91ab 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/NcStatementsPrinter.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/fields/NcStatementsPrinter.java
@@ -49,7 +49,7 @@

 /**
  * Prints what each statement produced, as a {@value #FIELD_NAME} array 
holding one object per statement: its position,
- * kind, signature, rows or handle, plans, outcome, error and metrics. A 
request carrying one statement is printed by the
+ * signature, rows or handle, plans, outcome, error and metrics. A request 
carrying one statement is printed by the
  * pre-existing path instead; see {@code 
NCQueryServiceServlet#useMultiStatementResponse}.
  * <p>
  * {@code metrics} comes after {@code results} because the row count and size 
are only final once the rows are streamed.
@@ -58,7 +58,6 @@

     public static final String FIELD_NAME = "statements";
     public static final String POSITION_FIELD_NAME = "statement";
-    public static final String KIND_FIELD_NAME = "kind";
     /**
      * What a statement reports for itself. The time the request took, and 
whether it failed, belong to the request: a
      * statement that failed says so with its status and its errors.
@@ -135,7 +134,6 @@
                 ? new ResultReader(resultSet, resultSetInfo.getJobId(), 
resultSetInfo.getResultSetId()) : null;

         fields.add(w -> printField(w, POSITION_FIELD_NAME, 
String.valueOf(statement.getPosition())));
-        fields.add(w -> printField(w, KIND_FIELD_NAME, 
quoted(statementKind(statement))));
         // a statement that returns rows describes them, as the flat response 
does; the signature is the default one
         // unless the client asked for a typed one, exactly as 
SignaturePrinter.newInstance decides for a request
         if (printSignature && resultSetInfo != null) {
@@ -229,14 +227,6 @@
         return new WarningsPrinter(warnings);
     }

-    /** The kind of a statement, or for an extension statement the name that 
identifies it. */
-    private static String statementKind(StatementInfo statement) {
-        if (statement.getName() != null) {
-            return statement.getName();
-        }
-        return statement.getKind() == null ? "unknown" : 
statement.getKind().getDisplayName();
-    }
-
     /**
      * The metrics of one statement. Elapsed and execution time are measured 
around the whole request, so they are
      * reported there. Public because a deployment recording a statement 
elsewhere records the same figures.
diff --git 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/result/NcStatementsPrinterTest.java
 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/result/NcStatementsPrinterTest.java
index f3bcec9..13d3c88 100644
--- 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/result/NcStatementsPrinterTest.java
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/result/NcStatementsPrinterTest.java
@@ -56,7 +56,6 @@
         Assert.assertEquals(statements.toString(), 1, 
statements.get(0).get("statement").asInt());
         Assert.assertEquals(statements.toString(), 2, 
statements.get(1).get("statement").asInt());
         Assert.assertEquals(statements.toString(), "success", 
statements.get(0).get("status").asText());
-        Assert.assertNotNull(statements.toString(), 
statements.get(0).get("kind"));
         Assert.assertNotNull(statements.toString(), 
statements.get(0).get("metrics"));
     }

@@ -85,16 +84,6 @@
         Assert.assertEquals(statements.toString(), 1, 
statements.get(0).get("statement").asInt());
     }

-    /** An extension statement is named by its name, since its kind alone does 
not identify it. */
-    @Test
-    public void anExtensionStatementIsReportedByName() throws Exception {
-        StatementInfo extension = new StatementInfo(1, 
Statement.Kind.EXTENSION, "DESCRIBE LINK");
-        extension.setStats(new Stats());
-        JsonNode statements = print(List.of(extension));
-
-        Assert.assertEquals(statements.toString(), "DESCRIBE LINK", 
statements.get(0).get("kind").asText());
-    }
-
     private static StatementInfo statement(int position, Statement.Kind kind) {
         StatementInfo statementInfo = new StatementInfo(position, kind, null);
         statementInfo.setStats(new Stats());

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21667?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I777beaeafcde3acef25022e2211dbe2a6aa18350
Gerrit-Change-Number: 21667
Gerrit-PatchSet: 1
Gerrit-Owner: Janhavi Tripurwar <[email protected]>

Reply via email to