public void addValue(String key, Object object) throws TeiidProcessingException { try { startValue(key); if (object == null) { writer.append("null"); //$NON-NLS-1$ remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e); } catch (SQLException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e);
public void addValue(String key, Object object) throws TeiidProcessingException { try { startValue(key); if (object == null) { writer.append("null"); //$NON-NLS-1$ remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e); } catch (SQLException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e);
evaluateSubquery(container, tuple); builder = new JSONBuilder(context.getBufferManager()); builder.start(false); for (NameValuePair<Object> nameValuePair : nameValuePairs) { addValue(tuple, builder, nameValuePair.name, nameValuePair.value); builder.end(false); if (returnValue) { ClobType result = builder.close(context); builder = null; return result; } finally { if (returnValue && builder != null) { builder.remove();
evaluateSubquery(container, tuple); builder = new JSONBuilder(context.getBufferManager()); builder.start(false); for (NameValuePair<Object> nameValuePair : nameValuePairs) { addValue(tuple, builder, nameValuePair.name, nameValuePair.value); builder.end(false); if (returnValue) { JsonType result = builder.close(context); builder = null; return result; } finally { if (returnValue && builder != null) { builder.remove();
builder = new JSONBuilder(context.getBufferManager()); builder.start(true); for (Object object : vals) { if (eval != null) { eval.addValue(tuple, builder, null, object); } else { builder.addValue(object); builder.end(true); if (returnValue) { JsonType result = builder.close(context); builder = null; return result; } finally { if (returnValue && builder != null) { builder.remove();
builder = new JSONBuilder(context.getBufferManager()); builder.start(true); for (Object object : vals) { if (eval != null) { eval.addValue(tuple, builder, null, object); } else { builder.addValue(object); builder.end(true); if (returnValue) { ClobType result = builder.close(context); builder = null; return result; } finally { if (returnValue && builder != null) { builder.remove();
evaluateSubquery(container, tuple); builder = new JSONBuilder(context.getBufferManager()); builder.start(false); for (NameValuePair<Object> nameValuePair : nameValuePairs) { addValue(tuple, builder, nameValuePair.name, nameValuePair.value); builder.end(false); if (returnValue) { JsonType result = builder.close(context); builder = null; return result; } finally { if (returnValue && builder != null) { builder.remove();
public void addValue(String key, Object object) throws TeiidProcessingException { try { startValue(key); if (object == null) { writer.append("null"); //$NON-NLS-1$ remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e); } catch (SQLException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e);
private void addValue(List<?> tuple, JSONBuilder builder, String name, Object value) throws TeiidProcessingException, ExpressionEvaluationException, BlockedException, TeiidComponentException, FunctionExecutionException { try { if (value instanceof JSONObject) { builder.startValue(name); evaluateJSONObject(tuple, (JSONObject)value, builder); return; } if (value instanceof Function) { Function f = (Function)value; if (f.getName().equalsIgnoreCase(FunctionLibrary.JSONARRAY)) { builder.startValue(name); jsonArray(context, f, f.getArgs(), builder, this, tuple); return; } } builder.addValue(name, internalEvaluate((Expression)value, tuple)); } catch (BlockedException e) { throw e; } }
builder = new JSONBuilder(context.getBufferManager()); builder.start(true); for (Object object : vals) { if (eval != null) { eval.addValue(tuple, builder, null, object); } else { builder.addValue(object); builder.end(true); if (returnValue) { JsonType result = builder.close(context); builder = null; return result; } finally { if (returnValue && builder != null) { builder.remove();
private void addValue(List<?> tuple, JSONBuilder builder, String name, Object value) throws TeiidProcessingException, ExpressionEvaluationException, BlockedException, TeiidComponentException, FunctionExecutionException { try { if (value instanceof JSONObject) { builder.startValue(name); evaluateJSONObject(tuple, (JSONObject)value, builder); return; } if (value instanceof Function) { Function f = (Function)value; if (f.getName().equalsIgnoreCase(FunctionLibrary.JSONARRAY)) { builder.startValue(name); jsonArray(context, f, f.getArgs(), builder, this, tuple); return; } } builder.addValue(name, internalEvaluate((Expression)value, tuple)); } catch (BlockedException e) { throw e; } }
public JsonType close(CommandContext cc) throws TeiidProcessingException { try { writer.close(); } catch (IOException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30442, e); } if (fsisf.getStorageMode() == StorageMode.MEMORY) { //detach if just in memory byte[] bytes = fsisf.getMemoryBytes(); fsisf.free(); JsonType result = new JsonType(new ClobImpl(new String(bytes, Streamable.CHARSET))); return result; } JsonType result = new JsonType(new ClobImpl(fsisf, -1)); if (cc != null) { cc.addCreatedLob(fsisf); } return result; }
public JsonType close(CommandContext cc) throws TeiidProcessingException { try { writer.close(); } catch (IOException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30442, e); } if (fsisf.getStorageMode() == StorageMode.MEMORY) { //detach if just in memory byte[] bytes = fsisf.getMemoryBytes(); fsisf.free(); JsonType result = new JsonType(new ClobImpl(new String(bytes, Streamable.CHARSET))); return result; } JsonType result = new JsonType(new ClobImpl(fsisf, -1)); if (cc != null) { cc.addCreatedLob(fsisf); } return result; }
private void addValue(List<?> tuple, JSONBuilder builder, String name, Object value) throws TeiidProcessingException, ExpressionEvaluationException, BlockedException, TeiidComponentException, FunctionExecutionException { try { if (value instanceof JSONObject) { builder.startValue(name); evaluateJSONObject(tuple, (JSONObject)value, builder); return; } if (value instanceof Function) { Function f = (Function)value; if (f.getName().equalsIgnoreCase(FunctionLibrary.JSONARRAY)) { builder.startValue(name); jsonArray(context, f, f.getArgs(), builder, this, tuple); return; } } builder.addValue(name, internalEvaluate((Expression)value, tuple)); } catch (BlockedException e) { throw e; } }
public ClobType close(CommandContext cc) throws TeiidProcessingException { try { writer.close(); } catch (IOException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30442, e); } if (fsisf.getStorageMode() == StorageMode.MEMORY) { //detach if just in memory byte[] bytes = fsisf.getMemoryBytes(); fsisf.free(); ClobType result = new ClobType(new ClobImpl(new String(bytes, Streamable.CHARSET))); result.setType(Type.JSON); return result; } ClobType result = new ClobType(new ClobImpl(fsisf, -1)); if (cc != null) { cc.addCreatedLob(fsisf); } result.setType(Type.JSON); return result; }
public void startValue(String key) throws TeiidProcessingException { try { if (position.peek() != 0) { writer.append(','); } position.add(position.pop() + 1); if (key != null) { writer.append('"'); JSONParser.escape(key, writer); writer.append('"'); writer.append(":"); //$NON-NLS-1$ } } catch (IOException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e); } }
public void startValue(String key) throws TeiidProcessingException { try { if (position.peek() != 0) { writer.append(','); } position.add(position.pop() + 1); if (key != null) { writer.append('"'); JSONParser.escape(key, writer); writer.append('"'); writer.append(":"); //$NON-NLS-1$ } } catch (IOException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e); } }
public void startValue(String key) throws TeiidProcessingException { try { if (position.peek() != 0) { writer.append(','); } position.add(position.pop() + 1); if (key != null) { writer.append('"'); JSONParser.escape(key, writer); writer.append('"'); writer.append(":"); //$NON-NLS-1$ } } catch (IOException e) { remove(); throw new TeiidProcessingException(QueryPlugin.Event.TEIID30438, e); } }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (result == null) { if (concat == null) { return null; } concat.end(true); result = concat.close(commandContext); concat = null; } return result; }
/** * @throws TeiidProcessingException * @throws TeiidComponentException * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (result == null) { if (concat == null) { return null; } concat.end(true); result = concat.close(commandContext); concat = null; } return result; }