public void addWarning(TeiidException warning) { if (context != null) { context.addWarning(warning); } }
public void addWarning(TeiidException warning) { if (context != null) { context.addWarning(warning); } }
public void addWarning(TeiidException warning) { if (context != null) { context.addWarning(warning); } }
TeiidProcessingException warning = new TeiidProcessingException(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31274, s.length(), DataTypeManager.MAX_STRING_LENGTH)); warning.setStackTrace(SourceWarning.EMPTY_STACK_TRACE); context.addWarning(warning);
TeiidProcessingException warning = new TeiidProcessingException(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31274, s.length(), DataTypeManager.MAX_STRING_LENGTH)); warning.setStackTrace(SourceWarning.EMPTY_STACK_TRACE); context.addWarning(warning);
@Override public StorageMode getStorageMode() { if (!saved) { try { getInputStream().close(); } catch (IOException e) { CommandContext cc = CommandContext.getThreadLocalContext(); if (cc != null) { cc.addWarning(e); } LogManager.logInfo(LogConstants.CTX_DQP, e.getMessage()); return StorageMode.FREE; } } return fsisf.getStorageMode(); }
@Override public StorageMode getStorageMode() { if (!saved) { try { getInputStream().close(); } catch (IOException e) { CommandContext cc = CommandContext.getThreadLocalContext(); if (cc != null) { cc.addWarning(e); } LogManager.logInfo(LogConstants.CTX_DQP, e.getMessage()); return StorageMode.FREE; } } return fsisf.getStorageMode(); }
@TeiidFunction(category=FunctionCategoryConstants.DATETIME, pushdown=PushDown.CAN_PUSHDOWN) public static Timestamp current_timestamp(CommandContext context, int precision) { if (precision > 9) { context.addWarning(new FunctionExecutionException(QueryPlugin.Event.TEIID31271, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31271, precision))); precision = 9; } if (precision == 9) { return context.currentTimestamp(); } Timestamp ts = context.currentTimestamp(); Timestamp clone = (Timestamp)ts.clone(); if (precision == 0) { clone.setNanos(0); return clone; } //reduce precision int val = (int)Math.pow(10, 9 - precision); clone.setNanos((clone.getNanos()/val)*val); return clone; }
@TeiidFunction(category=FunctionCategoryConstants.DATETIME, pushdown=PushDown.CAN_PUSHDOWN) public static Timestamp current_timestamp(CommandContext context, int precision) { if (precision > 9) { context.addWarning(new FunctionExecutionException(QueryPlugin.Event.TEIID31271, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31271, precision))); precision = 9; } if (precision == 9) { return context.currentTimestamp(); } Timestamp ts = context.currentTimestamp(); Timestamp clone = (Timestamp)ts.clone(); if (precision == 0) { clone.setNanos(0); return clone; } //reduce precision int val = (int)Math.pow(10, 9 - precision); clone.setNanos((clone.getNanos()/val)*val); return clone; }
@TeiidFunction(category=FunctionCategoryConstants.DATETIME, pushdown=PushDown.CAN_PUSHDOWN) public static Time current_time(CommandContext context, int precision) { if (precision != 0) { context.addWarning(new FunctionExecutionException(QueryPlugin.Event.TEIID31270, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31270, precision))); } return context.currentTime(); }
@TeiidFunction(category=FunctionCategoryConstants.DATETIME, pushdown=PushDown.CAN_PUSHDOWN) public static Time current_time(CommandContext context, int precision) { if (precision != 0) { context.addWarning(new FunctionExecutionException(QueryPlugin.Event.TEIID31270, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31270, precision))); } return context.currentTime(); }
private void processHeader(List<String> line) { nameIndexes = new HashMap<String, Integer>(); this.lineWidth = DataTypeManager.MAX_STRING_LENGTH * line.size(); for (String string : line) { if (string == null) { continue; } nameIndexes.put(string.toUpperCase(), nameIndexes.size()); } for (TextColumn col : table.getColumns()) { if (col.isOrdinal()) { continue; } String name = col.getName().toUpperCase(); if (col.getHeader() != null) { name = col.getHeader().toUpperCase(); } Integer index = nameIndexes.get(name); if (index == null) { getContext().addWarning(new TeiidProcessingException(QueryPlugin.Event.TEIID30181, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30181, col.getName(), systemId))); } nameIndexes.put(col.getName(), index); } }
private void processHeader(List<String> line) { nameIndexes = new HashMap<String, Integer>(); this.lineWidth = DataTypeManager.MAX_STRING_LENGTH * line.size(); for (String string : line) { if (string == null) { continue; } nameIndexes.put(string.toUpperCase(), nameIndexes.size()); } for (TextColumn col : table.getColumns()) { if (col.isOrdinal()) { continue; } String name = col.getName().toUpperCase(); if (col.getHeader() != null) { name = col.getHeader().toUpperCase(); } Integer index = nameIndexes.get(name); if (index == null) { getContext().addWarning(new TeiidProcessingException(QueryPlugin.Event.TEIID30181, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30181, col.getName(), systemId))); } nameIndexes.put(col.getName(), index); } }
@Override public void process(ProcedurePlan env) throws TeiidComponentException, TeiidProcessingException, TeiidSQLException { Object value = env.evaluateExpression(expression); LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, "Processing RAISE with the value :", value); //$NON-NLS-1$ if (warning) { env.getContext().addWarning((Exception)value); return; } if (value == null) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID31122, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31122)); } throw TeiidSQLException.create((Exception)value); }
@Override public void process(ProcedurePlan env) throws TeiidComponentException, TeiidProcessingException, TeiidSQLException { Object value = env.evaluateExpression(expression); LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, "Processing RAISE with the value :", value); //$NON-NLS-1$ if (warning) { env.getContext().addWarning((Exception)value); return; } if (value == null) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID31122, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31122)); } throw TeiidSQLException.create((Exception)value); }
@Override public void process(ProcedurePlan env) throws TeiidComponentException, TeiidProcessingException, TeiidSQLException { Object value = env.evaluateExpression(expression); LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, "Processing RAISE with the value :", value); //$NON-NLS-1$ if (warning) { env.getContext().addWarning((Exception)value); return; } if (value == null) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID31122, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31122)); } throw TeiidSQLException.create((Exception)value); }
void receiveResults(AtomicResultsMessage response, boolean partial) { this.arm = response; this.scope = response.getScope(); if (this.scope != null) { this.aqr.getCommandContext().setDeterminismLevel(CachingTupleSource.getDeterminismLevel(this.scope)); } explicitClose |= !arm.supportsImplicitClose(); rowsProcessed += response.getResults().length; index = 0; if (response.getWarnings() != null) { for (Exception warning : response.getWarnings()) { SourceWarning sourceFailure = new SourceWarning(this.aqr.getModelName(), aqr.getConnectorName(), warning, partial); this.aqr.getCommandContext().addWarning(sourceFailure); } } if (response.getFinalRow() >= 0) { done = true; } }
void receiveResults(AtomicResultsMessage response, boolean partial) { this.arm = response; this.scope = response.getScope(); if (this.scope != null) { this.aqr.getCommandContext().setDeterminismLevel(CachingTupleSource.getDeterminismLevel(this.scope)); } explicitClose |= !arm.supportsImplicitClose(); rowsProcessed += response.getResults().length; index = 0; if (response.getWarnings() != null) { for (Exception warning : response.getWarnings()) { SourceWarning sourceFailure = new SourceWarning(this.aqr.getModelName(), aqr.getConnectorName(), warning, partial); this.aqr.getCommandContext().addWarning(sourceFailure); } } if (response.getFinalRow() >= 0) { done = true; } }
void receiveResults(AtomicResultsMessage response, boolean partial) { this.arm = response; this.scope = response.getScope(); if (this.scope != null) { this.aqr.getCommandContext().setDeterminismLevel(CachingTupleSource.getDeterminismLevel(this.scope)); } explicitClose |= !arm.supportsImplicitClose(); rowsProcessed += response.getResults().length; index = 0; if (response.getWarnings() != null) { for (Exception warning : response.getWarnings()) { SourceWarning sourceFailure = new SourceWarning(this.aqr.getModelName(), aqr.getConnectorName(), warning, partial); this.aqr.getCommandContext().addWarning(sourceFailure); } } if (response.getFinalRow() >= 0) { done = true; } }
getContext().addWarning(TeiidSQLException.create(e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31266)));