flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] fhueske commented on a change in pull request #6606: [FLINK-10163] [sql-client] Support views in SQL Client
Date Fri, 24 Aug 2018 17:10:20 GMT
fhueske commented on a change in pull request #6606: [FLINK-10163] [sql-client] Support views
in SQL Client
URL: https://github.com/apache/flink/pull/6606#discussion_r212693978
 
 

 ##########
 File path: flink-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java
 ##########
 @@ -390,51 +395,101 @@ private void callSelect(SqlCommandCall cmdCall) {
 			view.open();
 
 			// view left
-			terminal.writer().println(CliStrings.messageInfo(CliStrings.MESSAGE_RESULT_QUIT).toAnsi());
-			terminal.flush();
+			printInfo(CliStrings.MESSAGE_RESULT_QUIT);
 		} catch (SqlExecutionException e) {
-			printException(e);
+			printExecutionException(e);
 		}
 	}
 
 	private boolean callInsertInto(SqlCommandCall cmdCall) {
-		terminal.writer().println(CliStrings.messageInfo(CliStrings.MESSAGE_SUBMITTING_STATEMENT).toAnsi());
-		terminal.flush();
+		printInfo(CliStrings.MESSAGE_SUBMITTING_STATEMENT);
 
 		try {
 			final ProgramTargetDescriptor programTarget = executor.executeUpdate(context, cmdCall.operands[0]);
 			terminal.writer().println(CliStrings.messageInfo(CliStrings.MESSAGE_STATEMENT_SUBMITTED).toAnsi());
 			terminal.writer().println(programTarget.toString());
 			terminal.flush();
 		} catch (SqlExecutionException e) {
-			printException(e);
+			printExecutionException(e);
 			return false;
 		}
 		return true;
 	}
 
-	private void callSource(SqlCommandCall cmdCall) {
-		final String pathString = cmdCall.operands[0];
+	private void callCreateView(SqlCommandCall cmdCall) {
+		final String name = cmdCall.operands[0];
+		final String query = cmdCall.operands[1];
+
+		try {
+			// validate with a copy
+			final SessionContext contextCopy = context.copy();
 
 Review comment:
   This check fails if the VIEW query contains UDFs. 
   It seems that these are not registered yet.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message