Chris Hillery has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/741
Change subject: ASTERIXDB-1361: Meaningful error when missing output-record-type
......................................................................
ASTERIXDB-1361: Meaningful error when missing output-record-type
Change-Id: Id5ca7d634b2be5164af82ad128ff577c0bdbd457
---
M asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/41/741/1
diff --git
a/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
b/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
index f1d20d0..7c4ede8 100644
--- a/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
+++ b/asterix-app/src/main/java/org/apache/asterix/result/ResultUtils.java
@@ -33,6 +33,7 @@
import org.apache.asterix.api.common.SessionConfig;
import org.apache.asterix.api.common.SessionConfig.OutputFormat;
import org.apache.asterix.api.http.servlet.APIServlet;
+import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.om.types.ARecordType;
import org.apache.http.ParseException;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -72,7 +73,12 @@
return s;
}
- public static void displayCSVHeader(ARecordType recordType, SessionConfig
conf) {
+ public static void displayCSVHeader(ARecordType recordType, SessionConfig
conf)
+ throws AsterixException {
+ if (recordType == null) {
+ throw new AsterixException(
+ "Cannot output CSV with header without specifying
output-record-type");
+ }
// If HTML-ifying, we have to output this here before the header -
// pretty ugly
if (conf.is(SessionConfig.FORMAT_HTML)) {
--
To view, visit https://asterix-gerrit.ics.uci.edu/741
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5ca7d634b2be5164af82ad128ff577c0bdbd457
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Chris Hillery <[email protected]>