idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
155,500 | public static void setCatalogProcedurePartitionInfo ( VoltCompiler compiler , Database db , Procedure procedure , ProcedurePartitionData partitionData ) throws VoltCompilerException { ParititonDataReturnType partitionClauseData = resolvePartitionData ( compiler , db , procedure , partitionData . m_tableName , partition... | Set partition table column and parameter index for catalog procedure |
155,501 | private KafkaInternalConsumerRunner createConsumerRunner ( Properties properties ) throws Exception { ClassLoader previous = Thread . currentThread ( ) . getContextClassLoader ( ) ; Thread . currentThread ( ) . setContextClassLoader ( getClass ( ) . getClassLoader ( ) ) ; try { Consumer < ByteBuffer , ByteBuffer > cons... | Create a Kafka consumer and runner . |
155,502 | void createSchema ( HsqlName name , Grantee owner ) { SqlInvariants . checkSchemaNameNotSystem ( name . name ) ; Schema schema = new Schema ( name , owner ) ; schemaMap . add ( name . name , schema ) ; } | Creates a schema belonging to the given grantee . |
155,503 | public HsqlName getSchemaHsqlName ( String name ) { if ( name == null ) { return defaultSchemaHsqlName ; } if ( SqlInvariants . INFORMATION_SCHEMA . equals ( name ) ) { return SqlInvariants . INFORMATION_SCHEMA_HSQLNAME ; } Schema schema = ( ( Schema ) schemaMap . get ( name ) ) ; if ( schema == null ) { throw Error . ... | If schemaName is null return the default schema name else return the HsqlName object for the schema . If schemaName does not exist throw . |
155,504 | boolean isSchemaAuthorisation ( Grantee grantee ) { Iterator schemas = allSchemaNameIterator ( ) ; while ( schemas . hasNext ( ) ) { String schemaName = ( String ) schemas . next ( ) ; if ( grantee . equals ( toSchemaOwner ( schemaName ) ) ) { return true ; } } return false ; } | is a grantee the authorization of any schema |
155,505 | void dropSchemas ( Grantee grantee , boolean cascade ) { HsqlArrayList list = getSchemas ( grantee ) ; Iterator it = list . iterator ( ) ; while ( it . hasNext ( ) ) { Schema schema = ( Schema ) it . next ( ) ; dropSchema ( schema . name . name , cascade ) ; } } | drop all schemas with the given authorisation |
155,506 | public HsqlArrayList getAllTables ( ) { Iterator schemas = allSchemaNameIterator ( ) ; HsqlArrayList alltables = new HsqlArrayList ( ) ; while ( schemas . hasNext ( ) ) { String name = ( String ) schemas . next ( ) ; HashMappedList current = getTables ( name ) ; alltables . addAll ( current . values ( ) ) ; } return al... | Returns an HsqlArrayList containing references to all non - system tables and views . This includes all tables and views registered with this Database . |
155,507 | public Table getTable ( Session session , String name , String schema ) { Table t = null ; if ( schema == null ) { t = findSessionTable ( session , name , schema ) ; } if ( t == null ) { schema = session . getSchemaName ( schema ) ; t = findUserTable ( session , name , schema ) ; } if ( t == null ) { if ( SqlInvariants... | Returns the specified user - defined table or view visible within the context of the specified Session or any system table of the given name . It excludes any temp tables created in other Sessions . Throws if the table does not exist in the context . |
155,508 | public Table getUserTable ( Session session , String name , String schema ) { Table t = findUserTable ( session , name , schema ) ; if ( t == null ) { throw Error . error ( ErrorCode . X_42501 , name ) ; } return t ; } | Returns the specified user - defined table or view visible within the context of the specified Session . It excludes system tables and any temp tables created in different Sessions . Throws if the table does not exist in the context . |
155,509 | public Table findUserTable ( Session session , String name , String schemaName ) { Schema schema = ( Schema ) schemaMap . get ( schemaName ) ; if ( schema == null ) { return null ; } if ( session != null ) { Table table = session . getLocalTable ( name ) ; if ( table != null ) { return table ; } } int i = schema . tabl... | Returns the specified user - defined table or view visible within the context of the specified schema . It excludes system tables . Returns null if the table does not exist in the context . |
155,510 | public Table findSessionTable ( Session session , String name , String schemaName ) { return session . findSessionTable ( name ) ; } | Returns the specified session context table . Returns null if the table does not exist in the context . |
155,511 | void dropTableOrView ( Session session , Table table , boolean cascade ) { session . commit ( false ) ; if ( table . isView ( ) ) { removeSchemaObject ( table . getName ( ) , cascade ) ; } else { dropTable ( session , table , cascade ) ; } } | Drops the specified user - defined view or table from this Database object . |
155,512 | int getTableIndex ( Table table ) { Schema schema = ( Schema ) schemaMap . get ( table . getSchemaName ( ) . name ) ; if ( schema == null ) { return - 1 ; } HsqlName name = table . getName ( ) ; return schema . tableList . getIndex ( name . name ) ; } | Returns index of a table or view in the HashMappedList that contains the table objects for this Database . |
155,513 | void recompileDependentObjects ( Table table ) { OrderedHashSet set = getReferencingObjects ( table . getName ( ) ) ; Session session = database . sessionManager . getSysSession ( ) ; for ( int i = 0 ; i < set . size ( ) ; i ++ ) { HsqlName name = ( HsqlName ) set . get ( i ) ; switch ( name . type ) { case SchemaObjec... | After addition or removal of columns and indexes all views that reference the table should be recompiled . |
155,514 | Table findUserTableForIndex ( Session session , String name , String schemaName ) { Schema schema = ( Schema ) schemaMap . get ( schemaName ) ; HsqlName indexName = schema . indexLookup . getName ( name ) ; if ( indexName == null ) { return null ; } return findUserTable ( session , indexName . parent . name , schemaNam... | Returns the table that has an index with the given name and schema . |
155,515 | public HsqlName getSchemaHsqlNameNoThrow ( String name , HsqlName defaultName ) { if ( name == null ) { return defaultSchemaHsqlName ; } if ( SqlInvariants . INFORMATION_SCHEMA . equals ( name ) ) { return SqlInvariants . INFORMATION_SCHEMA_HSQLNAME ; } Schema schema = ( ( Schema ) schemaMap . get ( name ) ) ; if ( sch... | If schemaName is null return the default schema name else return the HsqlName object for the schema . If schemaName does not exist return the defaultName provided . Not throwing the usual exception saves some throw - then - catch nonsense in the usual session setup . |
155,516 | public InitiateResponseMessage dedupe ( long inUniqueId , TransactionInfoBaseMessage in ) { if ( in instanceof Iv2InitiateTaskMessage ) { final Iv2InitiateTaskMessage init = ( Iv2InitiateTaskMessage ) in ; final StoredProcedureInvocation invocation = init . getStoredProcedureInvocation ( ) ; final String procName = inv... | Dedupe initiate task messages . Check if the initiate task message is seen before . |
155,517 | public void updateLastSeenUniqueId ( long inUniqueId , TransactionInfoBaseMessage in ) { if ( in instanceof Iv2InitiateTaskMessage && inUniqueId > m_lastSeenUniqueId ) { m_lastSeenUniqueId = inUniqueId ; } } | Update the last seen uniqueId for this partition if it s an initiate task message . |
155,518 | public VoltMessage poll ( ) { if ( m_mustDrain || m_replayEntries . isEmpty ( ) ) { return null ; } if ( m_replayEntries . firstEntry ( ) . getValue ( ) . isEmpty ( ) ) { m_replayEntries . pollFirstEntry ( ) ; } checkDrainCondition ( ) ; if ( m_mustDrain || m_replayEntries . isEmpty ( ) ) { return null ; } VoltMessage ... | Return the next correctly sequenced message or null if none exists . |
155,519 | public boolean offer ( long inUniqueId , TransactionInfoBaseMessage in ) { ReplayEntry found = m_replayEntries . get ( inUniqueId ) ; if ( in instanceof Iv2EndOfLogMessage ) { m_mpiEOLReached = true ; return true ; } if ( in instanceof MultiPartitionParticipantMessage ) { if ( inUniqueId <= m_lastPolledFragmentUniqueId... | Offer a new message . Return false if the offered message can be run immediately . |
155,520 | private void verifyDataCapacity ( int size ) { if ( size + 4 > m_dataNetwork . capacity ( ) ) { m_dataNetworkOrigin . discard ( ) ; m_dataNetworkOrigin = org . voltcore . utils . DBBPool . allocateDirect ( size + 4 ) ; m_dataNetwork = m_dataNetworkOrigin . b ( ) ; m_dataNetwork . position ( 4 ) ; m_data = m_dataNetwork... | private int m_counter ; |
155,521 | public void initialize ( final int clusterIndex , final long siteId , final int partitionId , final int sitesPerHost , final int hostId , final String hostname , final int drClusterId , final int defaultDrBufferSize , final long tempTableMemory , final HashinatorConfig hashinatorConfig , final boolean createDrReplicate... | the abstract api assumes construction initializes but here initialization is just another command . |
155,522 | protected void coreLoadCatalog ( final long timestamp , final byte [ ] catalogBytes ) throws EEException { int result = ExecutionEngine . ERRORCODE_ERROR ; verifyDataCapacity ( catalogBytes . length + 100 ) ; m_data . clear ( ) ; m_data . putInt ( Commands . LoadCatalog . m_id ) ; m_data . putLong ( timestamp ) ; m_dat... | write the catalog as a UTF - 8 byte string via connection |
155,523 | public void coreUpdateCatalog ( final long timestamp , final boolean isStreamUpdate , final String catalogDiffs ) throws EEException { int result = ExecutionEngine . ERRORCODE_ERROR ; try { final byte catalogBytes [ ] = catalogDiffs . getBytes ( "UTF-8" ) ; verifyDataCapacity ( catalogBytes . length + 100 ) ; m_data . ... | write the diffs as a UTF - 8 byte string via connection |
155,524 | private void sendDependencyTable ( final int dependencyId ) throws IOException { final byte [ ] dependencyBytes = nextDependencyAsBytes ( dependencyId ) ; if ( dependencyBytes == null ) { m_connection . m_socket . getOutputStream ( ) . write ( Connection . kErrorCode_DependencyNotFound ) ; return ; } final ByteBuffer m... | Retrieve a dependency table and send it via the connection . If no table is available send a response code indicating such . The message is prepended with two lengths . One length is for the network layer and is the size of the whole message not including the length prefix . |
155,525 | boolean enableScoreboard ( ) { assert ( s_barrier != null ) ; try { s_barrier . await ( 3L , TimeUnit . MINUTES ) ; } catch ( InterruptedException | BrokenBarrierException | TimeoutException e ) { hostLog . error ( "Cannot re-enable the scoreboard." ) ; s_barrier . reset ( ) ; return false ; } m_scoreboardEnabled = tru... | After all sites has been fully initialized and ready for snapshot we should enable the scoreboard . |
155,526 | synchronized void offer ( TransactionTask task ) { Iv2Trace . logTransactionTaskQueueOffer ( task ) ; TransactionState txnState = task . getTransactionState ( ) ; if ( ! m_backlog . isEmpty ( ) ) { if ( txnState . isSinglePartition ( ) ) { m_backlog . addLast ( task ) ; return ; } TransactionTask headTask = m_backlog .... | If necessary stick this task in the backlog . Many network threads may be racing to reach here synchronize to serialize queue order |
155,527 | synchronized int flush ( long txnId ) { if ( tmLog . isDebugEnabled ( ) ) { tmLog . debug ( "Flush backlog with txnId:" + TxnEgo . txnIdToString ( txnId ) + ", backlog head txnId is:" + ( m_backlog . isEmpty ( ) ? "empty" : TxnEgo . txnIdToString ( m_backlog . getFirst ( ) . getTxnId ( ) ) ) ) ; } int offered = 0 ; if ... | Try to offer as many runnable Tasks to the SiteTaskerQueue as possible . |
155,528 | public synchronized List < TransactionTask > getBacklogTasks ( ) { List < TransactionTask > pendingTasks = new ArrayList < > ( ) ; Iterator < TransactionTask > iter = m_backlog . iterator ( ) ; TransactionTask mpTask = iter . next ( ) ; assert ( ! mpTask . getTransactionState ( ) . isSinglePartition ( ) ) ; while ( ite... | Called from streaming snapshot execution |
155,529 | public synchronized void removeMPReadTransactions ( ) { TransactionTask task = m_backlog . peekFirst ( ) ; while ( task != null && task . getTransactionState ( ) . isReadOnly ( ) ) { task . getTransactionState ( ) . setDone ( ) ; flush ( task . getTxnId ( ) ) ; task = m_backlog . peekFirst ( ) ; } } | flush mp readonly transactions out of backlog |
155,530 | public List < List < GeographyPointValue > > getRings ( ) { List < List < GeographyPointValue > > llLoops = new ArrayList < > ( ) ; boolean isShell = true ; for ( List < XYZPoint > xyzLoop : m_loops ) { List < GeographyPointValue > llLoop = new ArrayList < > ( ) ; llLoop . add ( xyzLoop . get ( 0 ) . toGeographyPointVa... | Return the list of rings of a polygon . The list has the same values as the list of rings used to construct the polygon or the sequence of WKT rings used to construct the polygon . |
155,531 | public String toWKT ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "POLYGON (" ) ; boolean isFirstLoop = true ; for ( List < XYZPoint > loop : m_loops ) { if ( ! isFirstLoop ) { sb . append ( ", " ) ; } sb . append ( "(" ) ; int startIdx = ( isFirstLoop ? 1 : loop . size ( ) - 1 ) ; int endIdx = ( isFirst... | Return a representation of this object as well - known text . |
155,532 | public int getLengthInBytes ( ) { long length = polygonOverheadInBytes ( ) ; for ( List < XYZPoint > loop : m_loops ) { length += loopLengthInBytes ( loop . size ( ) ) ; } return ( int ) length ; } | Return the number of bytes in the serialization for this polygon . Returned value does not include the 4 - byte length prefix that precedes variable - length types . |
155,533 | private static < T > void diagnoseLoop ( List < T > loop , String excpMsgPrf ) throws IllegalArgumentException { if ( loop == null ) { throw new IllegalArgumentException ( excpMsgPrf + "a polygon must contain at least one ring " + "(with each ring at least 4 points, including repeated closing vertex)" ) ; } if ( loop .... | A helper function to validate the loop structure If loop is invalid it generates IllegalArgumentException exception |
155,534 | public GeographyValue add ( GeographyPointValue offset ) { List < List < GeographyPointValue > > newLoops = new ArrayList < > ( ) ; for ( List < XYZPoint > oneLoop : m_loops ) { List < GeographyPointValue > loop = new ArrayList < > ( ) ; for ( XYZPoint p : oneLoop ) { loop . add ( p . toGeographyPointValue ( ) . add ( ... | Create a new GeographyValue which is offset from this one by the given point . The latitude and longitude values stay in range because we are using the normalizing operations in GeographyPointValue . |
155,535 | public void sync ( ) { if ( isClosed ) { return ; } synchronized ( fileStreamOut ) { if ( needsSync ) { if ( busyWriting ) { forceSync = true ; return ; } try { fileStreamOut . flush ( ) ; outDescriptor . sync ( ) ; syncCount ++ ; } catch ( IOException e ) { Error . printSystemOut ( "flush() or sync() error: " + e . to... | Called internally or externally in write delay intervals . |
155,536 | protected void openFile ( ) { try { FileAccess fa = isDump ? FileUtil . getDefaultInstance ( ) : database . getFileAccess ( ) ; OutputStream fos = fa . openOutputStreamElement ( outFile ) ; outDescriptor = fa . getFileSync ( fos ) ; fileStreamOut = new BufferedOutputStream ( fos , 2 << 12 ) ; } catch ( IOException e ) ... | File is opened in append mode although in current usage the file never pre - exists |
155,537 | private Runnable createRunnableLoggingTask ( final Level level , final Object message , final Throwable t ) { final String callerThreadName = Thread . currentThread ( ) . getName ( ) ; final Runnable runnableLoggingTask = new Runnable ( ) { public void run ( ) { Thread loggerThread = Thread . currentThread ( ) ; logger... | Generate a runnable task that logs one message in an exception - safe way . |
155,538 | private Runnable createRunnableL7dLoggingTask ( final Level level , final String key , final Object [ ] params , final Throwable t ) { final String callerThreadName = Thread . currentThread ( ) . getName ( ) ; final Runnable runnableLoggingTask = new Runnable ( ) { public void run ( ) { Thread loggerThread = Thread . c... | Generate a runnable task that logs one localized message in an exception - safe way . |
155,539 | public static void configure ( String xmlConfig , File voltroot ) { try { Class < ? > loggerClz = Class . forName ( "org.voltcore.logging.VoltLog4jLogger" ) ; assert ( loggerClz != null ) ; Method configureMethod = loggerClz . getMethod ( "configure" , String . class , File . class ) ; configureMethod . invoke ( null ,... | Static method to change the Log4j config globally . This fails if you re not using Log4j for now . |
155,540 | public T get ( String name ) { if ( m_items == null ) { return null ; } return m_items . get ( name . toUpperCase ( ) ) ; } | Get an item from the map by name |
155,541 | public Iterator < T > iterator ( ) { if ( m_items == null ) { m_items = new TreeMap < String , T > ( ) ; } return m_items . values ( ) . iterator ( ) ; } | Get an iterator for the items in the map |
155,542 | private static void validateMigrateStmt ( String sql , VoltXMLElement xmlSQL , Database db ) { final Map < String , String > attributes = xmlSQL . attributes ; assert attributes . size ( ) == 1 ; final Table targetTable = db . getTables ( ) . get ( attributes . get ( "table" ) ) ; assert targetTable != null ; final Cat... | Check that MIGRATE FROM tbl WHERE ... statement is valid . |
155,543 | public String parameterize ( ) { Set < Integer > paramIds = new HashSet < > ( ) ; ParameterizationInfo . findUserParametersRecursively ( m_xmlSQL , paramIds ) ; m_adhocUserParamsCount = paramIds . size ( ) ; m_paramzInfo = null ; if ( paramIds . size ( ) == 0 ) { m_paramzInfo = ParameterizationInfo . parameterize ( m_x... | Auto - parameterize all of the literals in the parsed SQL statement . |
155,544 | public CompiledPlan plan ( ) throws PlanningErrorException { m_recentErrorMsg = null ; if ( m_paramzInfo != null ) { try { CompiledPlan plan = compileFromXML ( m_paramzInfo . getParameterizedXmlSQL ( ) , m_paramzInfo . getParamLiteralValues ( ) ) ; if ( plan != null ) { if ( plan . extractParamValues ( m_paramzInfo ) )... | Get the best plan for the SQL statement given assuming the given costModel . |
155,545 | private void harmonizeCommonTableSchemas ( CompiledPlan plan ) { List < AbstractPlanNode > seqScanNodes = plan . rootPlanGraph . findAllNodesOfClass ( SeqScanPlanNode . class ) ; for ( AbstractPlanNode planNode : seqScanNodes ) { SeqScanPlanNode seqScanNode = ( SeqScanPlanNode ) planNode ; StmtCommonTableScan scan = se... | Make sure that schemas in base and recursive plans in common table scans have identical schemas . This is important because otherwise we will get data corruption in the EE . We look for SeqScanPlanNodes then look for a common table scan and ask the scan node to harmonize its schemas . |
155,546 | public void resetCapacity ( int newCapacity , int newPolicy ) throws IllegalArgumentException { if ( newCapacity != 0 && hashIndex . elementCount > newCapacity ) { int surplus = hashIndex . elementCount - newCapacity ; surplus += ( surplus >> 5 ) ; if ( surplus > hashIndex . elementCount ) { surplus = hashIndex . eleme... | In rare circumstances resetCapacity may not succeed in which case capacity remains unchanged but purge policy is set to newPolicy |
155,547 | protected void initParams ( Database database , String baseFileName ) { fileName = baseFileName + ".data.tmp" ; this . database = database ; fa = FileUtil . getDefaultInstance ( ) ; int cacheSizeScale = 10 ; cacheFileScale = 8 ; Error . printSystemOut ( "cache_size_scale: " + cacheSizeScale ) ; maxCacheSize = 2048 ; in... | Initial external parameters are set here . The size if fixed . |
155,548 | public synchronized void close ( boolean write ) { try { if ( dataFile != null ) { dataFile . close ( ) ; dataFile = null ; fa . removeElement ( fileName ) ; } } catch ( Throwable e ) { database . logger . appLog . logContext ( e , null ) ; throw Error . error ( ErrorCode . FILE_IO_ERROR , ErrorCode . M_DataFileCache_c... | Parameter write is always false . The backing file is simply closed and deleted . |
155,549 | private AbstractPlanNode recursivelyApply ( AbstractPlanNode plan , int childIdx ) { if ( plan instanceof InsertPlanNode ) { InsertPlanNode insertNode = ( InsertPlanNode ) plan ; assert ( insertNode . getChildCount ( ) == 1 ) ; AbstractPlanNode abstractChild = insertNode . getChild ( 0 ) ; ScanPlanNodeWhichCanHaveInlin... | This helper function is called when we recurse down the childIdx - th child of a parent node . |
155,550 | static void updateTableNames ( List < ParsedColInfo > src , String tblName ) { src . forEach ( ci -> ci . updateTableName ( tblName , tblName ) . toTVE ( ci . m_index , ci . m_index ) ) ; } | table names . |
155,551 | ParsedSelectStmt rewriteAsMV ( Table view ) { m_groupByColumns . clear ( ) ; m_distinctGroupByColumns = null ; m_groupByExpressions . clear ( ) ; m_distinctProjectSchema = null ; m_distinct = m_hasAggregateExpression = m_hasComplexGroupby = m_hasComplexAgg = false ; setParamsByIndex ( new TreeMap < > ( ) ) ; m_paramsBy... | Updates miscellaneous fields as part of rewriting as materialized view . |
155,552 | public StmtTargetTableScan generateStmtTableScan ( Table view ) { StmtTargetTableScan st = new StmtTargetTableScan ( view ) ; m_displayColumns . forEach ( ci -> st . resolveTVE ( ( TupleValueExpression ) ( ci . m_expression ) ) ) ; defineTableScanByAlias ( view . getTypeName ( ) , st ) ; return st ; } | Generate table scan and add the scan to m_tableAliasMap |
155,553 | public void switchOptimalSuiteForAvgPushdown ( ) { m_displayColumns = m_avgPushdownDisplayColumns ; m_aggResultColumns = m_avgPushdownAggResultColumns ; m_groupByColumns = m_avgPushdownGroupByColumns ; m_distinctGroupByColumns = m_avgPushdownDistinctGroupByColumns ; m_orderColumns = m_avgPushdownOrderColumns ; m_projec... | Switch the optimal set for pushing down AVG |
155,554 | private void prepareMVBasedQueryFix ( ) { if ( m_hasComplexGroupby ) { m_mvFixInfo . setEdgeCaseQueryNoFixNeeded ( false ) ; } for ( StmtTableScan mvTableScan : allScans ( ) ) { Set < SchemaColumn > mvNewScanColumns = new HashSet < > ( ) ; Collection < SchemaColumn > columns = mvTableScan . getScanColumns ( ) ; if ( co... | Prepare for the mv based distributed query fix only if it might be required . |
155,555 | private void placeTVEsinColumns ( ) { Map < AbstractExpression , Integer > aggTableIndexMap = new HashMap < > ( ) ; Map < Integer , ParsedColInfo > indexToColumnMap = new HashMap < > ( ) ; int index = 0 ; for ( ParsedColInfo col : m_aggResultColumns ) { aggTableIndexMap . put ( col . m_expression , index ) ; if ( col .... | Generate new output Schema and Place TVEs for display columns if needed . Place TVEs for order by columns always . |
155,556 | private void insertAggExpressionsToAggResultColumns ( List < AbstractExpression > aggColumns , ParsedColInfo cookedCol ) { for ( AbstractExpression expr : aggColumns ) { assert ( expr instanceof AggregateExpression ) ; if ( expr . hasSubquerySubexpression ( ) ) { throw new PlanningErrorException ( "SQL Aggregate functi... | ParseDisplayColumns and ParseOrderColumns will call this function to add Aggregation expressions to aggResultColumns |
155,557 | private static void insertToColumnList ( List < ParsedColInfo > columnList , List < ParsedColInfo > newCols ) { for ( ParsedColInfo col : newCols ) { if ( ! columnList . contains ( col ) ) { columnList . add ( col ) ; } } } | Concat elements to the XXXColumns list |
155,558 | private void findAllTVEs ( AbstractExpression expr , List < TupleValueExpression > tveList ) { if ( ! isNewtoColumnList ( m_aggResultColumns , expr ) ) { return ; } if ( expr instanceof TupleValueExpression ) { tveList . add ( ( TupleValueExpression ) expr . clone ( ) ) ; return ; } if ( expr . getLeft ( ) != null ) { ... | Find all TVEs except inside of AggregationExpression |
155,559 | private void verifyWindowFunctionExpressions ( ) { if ( m_windowFunctionExpressions . size ( ) > 0 ) { if ( m_windowFunctionExpressions . size ( ) > 1 ) { throw new PlanningErrorException ( "Only one windowed function call may appear in a selection list." ) ; } if ( m_hasAggregateExpression ) { throw new PlanningErrorE... | Verify the validity of the windowed expressions . |
155,560 | private boolean canPushdownLimit ( ) { boolean limitCanPushdown = ( m_limitOffset . hasLimit ( ) && ! m_distinct ) ; if ( limitCanPushdown ) { for ( ParsedColInfo col : m_displayColumns ) { AbstractExpression rootExpr = col . m_expression ; if ( rootExpr instanceof AggregateExpression ) { if ( ( ( AggregateExpression )... | Check if the LimitPlanNode can be pushed down . The LimitPlanNode may have a LIMIT clause only OFFSET clause only or both . Offset only cannot be pushed down . |
155,561 | private boolean isValidJoinOrder ( List < String > tableAliases ) { assert ( m_joinTree != null ) ; List < JoinNode > subTrees = m_joinTree . extractSubTrees ( ) ; int tableNameIdx = 0 ; List < JoinNode > finalSubTrees = new ArrayList < > ( ) ; for ( int i = subTrees . size ( ) - 1 ; i >= 0 ; -- i ) { JoinNode subTree ... | Validate the specified join order against the join tree . In general outer joins are not associative and commutative . Not all orders are valid . In case of a valid join order the initial join tree is rebuilt to match the specified order |
155,562 | public boolean isOrderDeterministic ( ) { if ( ! hasTopLevelScans ( ) ) { return true ; } if ( hasAOneRowResult ( ) ) { return true ; } if ( ! hasOrderByColumns ( ) ) { return false ; } ArrayList < AbstractExpression > nonOrdered = new ArrayList < > ( ) ; if ( isGrouped ( ) ) { if ( orderByColumnsDetermineAllColumns ( ... | Returns true if this select statement can be proved to always produce its result rows in the same order every time that it is executed . |
155,563 | public boolean orderByColumnsDetermineAllDisplayColumnsForUnion ( List < ParsedColInfo > orderColumns ) { Set < AbstractExpression > orderExprs = new HashSet < > ( ) ; for ( ParsedColInfo col : orderColumns ) { orderExprs . add ( col . m_expression ) ; } for ( ParsedColInfo col : m_displayColumns ) { if ( ! orderExprs ... | This is a very simple version of the above method for when an ORDER BY clause appears on a UNION . Does the ORDER BY clause reference every item on the display list? If so then the order is deterministic . |
155,564 | public boolean isPartitionColumnInWindowedAggregatePartitionByList ( ) { if ( getWindowFunctionExpressions ( ) . size ( ) == 0 ) { return false ; } assert ( getWindowFunctionExpressions ( ) . size ( ) == 1 ) ; WindowFunctionExpression we = getWindowFunctionExpressions ( ) . get ( 0 ) ; List < AbstractExpression > parti... | Return true iff all the windowed partition expressions have a table partition column in their partition by list and if there is one such windowed partition expression . If there are no windowed expressions we return false . Note that there can only be one windowed expression currently so this is more general than it ne... |
155,565 | public static GeographyValue CreateRegularConvex ( GeographyPointValue center , GeographyPointValue firstVertex , int numVertices , double sizeOfHole ) { assert ( 0 <= sizeOfHole && sizeOfHole < 1.0 ) ; double phi = 360.0 / numVertices ; GeographyPointValue holeFirstVertex = null ; if ( sizeOfHole > 0 ) { holeFirstVert... | Create a regular convex polygon with an optional hole . |
155,566 | public static GeographyValue reverseLoops ( GeographyValue goodPolygon ) { List < List < GeographyPointValue > > newLoops = new ArrayList < > ( ) ; List < List < GeographyPointValue > > oldLoops = goodPolygon . getRings ( ) ; for ( List < GeographyPointValue > loop : oldLoops ) { List < GeographyPointValue > newLoop = ... | Reverse all the loops in a polygon . Don t change the order of the loops just reverse each loop . |
155,567 | public void grant ( String granteeName , String roleName , Grantee grantor ) { Grantee grantee = get ( granteeName ) ; if ( grantee == null ) { throw Error . error ( ErrorCode . X_28501 , granteeName ) ; } if ( isImmutable ( granteeName ) ) { throw Error . error ( ErrorCode . X_28502 , granteeName ) ; } Grantee role = ... | Grant a role to this Grantee . |
155,568 | public void revoke ( String granteeName , String roleName , Grantee grantor ) { if ( ! grantor . isAdmin ( ) ) { throw Error . error ( ErrorCode . X_42507 ) ; } Grantee grantee = get ( granteeName ) ; if ( grantee == null ) { throw Error . error ( ErrorCode . X_28000 , granteeName ) ; } Grantee role = ( Grantee ) roleM... | Revoke a role from a Grantee |
155,569 | void removeEmptyRole ( Grantee role ) { for ( int i = 0 ; i < map . size ( ) ; i ++ ) { Grantee grantee = ( Grantee ) map . get ( i ) ; grantee . roles . remove ( role ) ; } } | Removes a role without any privileges from all grantees |
155,570 | public void removeDbObject ( HsqlName name ) { for ( int i = 0 ; i < map . size ( ) ; i ++ ) { Grantee g = ( Grantee ) map . get ( i ) ; g . revokeDbObject ( name ) ; } } | Removes all rights mappings for the database object identified by the dbobject argument from all Grantee objects in the set . |
155,571 | void updateAllRights ( Grantee role ) { for ( int i = 0 ; i < map . size ( ) ; i ++ ) { Grantee grantee = ( Grantee ) map . get ( i ) ; if ( grantee . isRole ) { grantee . updateNestedRoles ( role ) ; } } for ( int i = 0 ; i < map . size ( ) ; i ++ ) { Grantee grantee = ( Grantee ) map . get ( i ) ; if ( ! grantee . is... | First updates all ROLE Grantee objects . Then updates all USER Grantee Objects . |
155,572 | public Grantee getRole ( String name ) { Grantee g = ( Grantee ) roleMap . get ( name ) ; if ( g == null ) { throw Error . error ( ErrorCode . X_0P000 , name ) ; } return g ; } | Returns Grantee for the named Role |
155,573 | private void connect ( Session session , boolean withReadOnlyData ) { if ( ( dataSource . length ( ) == 0 ) || isConnected ) { return ; } PersistentStore store = database . persistentStoreCollection . getStore ( this ) ; this . store = store ; DataFileCache cache = null ; try { cache = ( TextCache ) database . logger .... | connects to the data source |
155,574 | public void disconnect ( ) { this . store = null ; PersistentStore store = database . persistentStoreCollection . getStore ( this ) ; store . release ( ) ; isConnected = false ; } | disconnects from the data source |
155,575 | private void openCache ( Session session , String dataSourceNew , boolean isReversedNew , boolean isReadOnlyNew ) { String dataSourceOld = dataSource ; boolean isReversedOld = isReversed ; boolean isReadOnlyOld = isReadOnly ; if ( dataSourceNew == null ) { dataSourceNew = "" ; } disconnect ( ) ; dataSource = dataSource... | This method does some of the work involved with managing the creation and openning of the cache the rest is done in Log . java and TextCache . java . |
155,576 | protected void setDataSource ( Session session , String dataSourceNew , boolean isReversedNew , boolean createFile ) { if ( getTableType ( ) == Table . TEMP_TEXT_TABLE ) { ; } else { session . getGrantee ( ) . checkSchemaUpdateOrGrantRights ( getSchemaName ( ) . name ) ; } dataSourceNew = dataSourceNew . trim ( ) ; if ... | High level command to assign a data source to the table definition . Reassigns only if the data source or direction has changed . |
155,577 | void checkDataReadOnly ( ) { if ( dataSource . length ( ) == 0 ) { throw Error . error ( ErrorCode . TEXT_TABLE_UNKNOWN_DATA_SOURCE ) ; } if ( isReadOnly ) { throw Error . error ( ErrorCode . DATA_IS_READONLY ) ; } } | Used by INSERT DELETE UPDATE operations . This class will return a more appropriate message when there is no data source . |
155,578 | public void addBatch ( ) throws SQLException { checkClosed ( ) ; if ( this . Query . isOfType ( VoltSQL . TYPE_EXEC , VoltSQL . TYPE_SELECT ) ) { throw SQLError . get ( SQLError . ILLEGAL_STATEMENT , this . Query . toSqlString ( ) ) ; } this . addBatch ( this . Query . getExecutableQuery ( this . parameters ) ) ; this ... | Adds a set of parameters to this PreparedStatement object s batch of commands . |
155,579 | public boolean execute ( ) throws SQLException { checkClosed ( ) ; boolean result = this . execute ( this . Query . getExecutableQuery ( this . parameters ) ) ; this . parameters = this . Query . getParameterArray ( ) ; return result ; } | Executes the SQL statement in this PreparedStatement object which may be any kind of SQL statement . |
155,580 | public ResultSet executeQuery ( ) throws SQLException { checkClosed ( ) ; if ( ! this . Query . isOfType ( VoltSQL . TYPE_EXEC , VoltSQL . TYPE_SELECT ) ) { throw SQLError . get ( SQLError . ILLEGAL_STATEMENT , this . Query . toSqlString ( ) ) ; } ResultSet result = this . executeQuery ( this . Query . getExecutableQue... | Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query . |
155,581 | public void setArray ( int parameterIndex , Array x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; throw SQLError . noSupport ( ) ; } | Sets the designated parameter to the given java . sql . Array object . |
155,582 | public void setByte ( int parameterIndex , byte x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ; } | Sets the designated parameter to the given Java byte value . |
155,583 | public void setBytes ( int parameterIndex , byte [ ] x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ; } | Sets the designated parameter to the given Java array of bytes . |
155,584 | public void setCharacterStream ( int parameterIndex , Reader reader ) throws SQLException { checkParameterBounds ( parameterIndex ) ; throw SQLError . noSupport ( ) ; } | Sets the designated parameter to the given Reader object . |
155,585 | public void setDouble ( int parameterIndex , double x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ; } | Sets the designated parameter to the given Java double value . |
155,586 | public void setFloat ( int parameterIndex , float x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = ( double ) x ; } | Sets the designated parameter to the given Java float value . |
155,587 | public void setInt ( int parameterIndex , int x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ; } | Sets the designated parameter to the given Java int value . |
155,588 | public void setLong ( int parameterIndex , long x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ; } | Sets the designated parameter to the given Java long value . |
155,589 | public void setNString ( int parameterIndex , String value ) throws SQLException { checkParameterBounds ( parameterIndex ) ; throw SQLError . noSupport ( ) ; } | Sets the designated paramter to the given String object . |
155,590 | public void setNull ( int parameterIndex , int sqlType ) throws SQLException { checkParameterBounds ( parameterIndex ) ; switch ( sqlType ) { case Types . TINYINT : this . parameters [ parameterIndex - 1 ] = VoltType . NULL_TINYINT ; break ; case Types . SMALLINT : this . parameters [ parameterIndex - 1 ] = VoltType . ... | Sets the designated parameter to SQL NULL . |
155,591 | public void setObject ( int parameterIndex , Object x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ; } | Sets the value of the designated parameter using the given object . |
155,592 | public void setShort ( int parameterIndex , short x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x ; } | Sets the designated parameter to the given Java short value . |
155,593 | public void setTimestamp ( int parameterIndex , Timestamp x , Calendar cal ) throws SQLException { checkParameterBounds ( parameterIndex ) ; throw SQLError . noSupport ( ) ; } | Sets the designated parameter to the given java . sql . Timestamp value using the given Calendar object . |
155,594 | public void setURL ( int parameterIndex , URL x ) throws SQLException { checkParameterBounds ( parameterIndex ) ; this . parameters [ parameterIndex - 1 ] = x == null ? VoltType . NULL_STRING_OR_VARBINARY : x . toString ( ) ; } | Sets the designated parameter to the given java . net . URL value . |
155,595 | public final AbstractImporter createImporter ( ImporterConfig config ) { AbstractImporter importer = create ( config ) ; importer . setImportServerAdapter ( m_importServerAdapter ) ; return importer ; } | Method that is used by the importer framework classes to create an importer instance and wire it correctly for use within the server . |
155,596 | private static final byte [ ] expandToLength16 ( byte scaledValue [ ] , final boolean isNegative ) { if ( scaledValue . length == 16 ) { return scaledValue ; } byte replacement [ ] = new byte [ 16 ] ; if ( isNegative ) { Arrays . fill ( replacement , ( byte ) - 1 ) ; } int shift = ( 16 - scaledValue . length ) ; for ( ... | Converts BigInteger s byte representation containing a scaled magnitude to a fixed size 16 byte array and set the sign in the most significant byte s most significant bit . |
155,597 | public static BigDecimal deserializeBigDecimalFromString ( String decimal ) throws IOException { if ( decimal == null ) { return null ; } BigDecimal bd = new BigDecimal ( decimal ) ; if ( bd . scale ( ) > kDefaultScale ) { bd = bd . stripTrailingZeros ( ) ; if ( bd . scale ( ) > kDefaultScale ) { bd = roundToScale ( bd... | Deserialize a Volt fixed precision and scale 16 - byte decimal from a String representation |
155,598 | private static boolean isFileModifiedInCollectionPeriod ( File file ) { long diff = m_currentTimeMillis - file . lastModified ( ) ; if ( diff >= 0 ) { return TimeUnit . MILLISECONDS . toDays ( diff ) + 1 <= m_config . days ; } return false ; } | value of diff = 0 indicates current day |
155,599 | public static boolean voltMutateToBigintType ( Expression maybeConstantNode , Expression parent , int childIndex ) { if ( maybeConstantNode . opType == OpTypes . VALUE && maybeConstantNode . dataType != null && maybeConstantNode . dataType . isBinaryType ( ) ) { ExpressionValue exprVal = ( ExpressionValue ) maybeConsta... | Given a ExpressionValue that is a VARBINARY constant convert it to a BIGINT constant . Returns true for a successful conversion and false otherwise . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.