|
static void | PlaceAt (IList< int > list, int index, int value) |
|
Definition at line 27 of file FunctionTable.cs.
Deveel.Data.Sql.Tables.FunctionTable.FunctionTable |
( |
SqlExpression[] |
functionList, |
|
|
string[] |
columnNames, |
|
|
IRequest |
queryContext |
|
) |
| |
|
inline |
Definition at line 48 of file FunctionTable.cs.
49 :
this(queryContext.Query.Session.Transaction.Database.SingleRowTable, functionList, columnNames, queryContext) {
Deveel.Data.Sql.Tables.FunctionTable.FunctionTable |
( |
ITable |
table, |
|
|
SqlExpression[] |
functionList, |
|
|
string[] |
columnNames, |
|
|
IRequest |
queryContext |
|
) |
| |
|
inline |
Definition at line 52 of file FunctionTable.cs.
53 : base(queryContext.Context) {
72 expInfo =
new byte[functionList.Length];
76 for (
int i = 0; i < functionList.Length; ++i) {
77 var expr = functionList[i];
79 if (expr.IsConstant() && !expr.HasAggregate(
context)) {
81 var result = expr.Evaluate(
context, null);
83 throw new InvalidOperationException();
readonly TableInfo funTableInfo
FunctionTable(SqlExpression[] functionList, string[] columnNames, IRequest queryContext)
ITableVariableResolver ForRow(int rowIndex)
static readonly ObjectName FunctionTableName
SqlExpressionType
All the possible type of SqlExpression supported
void AddColumn(ColumnInfo column)
Adds a new column to the table at the last position of the columns list in the table metadata...
TableInfo AsReadOnly()
Creates a new instance of TableInfo as an immutable copy of this table metadata.
override TableInfo TableInfo
readonly ITableVariableResolver varResolver
Defines the base class for instances that represent SQL expression tree nodes.
readonly IRequest context
readonly SqlExpression[] expList
void SetupIndexes(string indexTypeName)
Definition at line 311 of file FunctionTable.cs.
323 while (en.MoveNext()) {
IList< int > wholeTableGroup
bool wholeTableIsSimpleEnum
int RowCount
Gets the total number of rows in the table.
TableGroupResolver groupResolver
Definition at line 165 of file FunctionTable.cs.
175 throw new ArgumentException();
void Set(CachedCell cell)
ITableVariableResolver ForRow(int rowIndex)
ITransaction Transaction
Gets the instance of ITransaction that handles the transactional operations of this session...
SqlExpressionType
All the possible type of SqlExpression supported
virtual SqlExpression Evaluate(EvaluateContext context)
When overridden by a derived class, this method evaluates the expression within the provided context...
readonly ITableVariableResolver varResolver
An expression that holds a constant value.
readonly IRequest context
void SetUpGroupForRow(int rowIndex)
readonly SqlExpression[] expList
TableGroupResolver groupResolver
Definition at line 333 of file FunctionTable.cs.
335 if (
RowCount <= 0 || columns.Length <= 0)
340 int[] colLookup =
new int[columns.Length];
341 for (
int i = columns.Length - 1; i >= 0; --i) {
342 colLookup[i] = rootTable.IndexOfColumn(columns[i]);
345 var rowList = rootTable.OrderRowsByColumns(colLookup).ToList();
358 int currentGroup = 0;
359 int previousRow = -1;
360 for (
int i = 0; i <
rowCount; i++) {
361 var rowIndex = rowList[i];
363 if (previousRow != -1) {
366 for (
int n = 0; n < colLookup.Length && equal; ++n) {
367 var c1 = rootTable.GetValue(rowIndex, colLookup[n]);
368 var c2 = rootTable.GetValue(previousRow, colLookup[n]);
369 equal = (c1.CompareTo(c2) == 0);
374 groupLinks.Add(previousRow | 0x040000000);
375 currentGroup = groupLinks.Count;
377 groupLinks.Add(previousRow);
384 previousRow = rowIndex;
388 groupLinks.Add(previousRow | 0x040000000);
static void PlaceAt(IList< int > list, int index, int value)
TableGroupResolver groupResolver
override IEnumerator<Row> Deveel.Data.Sql.Tables.FunctionTable.GetEnumerator |
( |
| ) |
|
|
inlinevirtual |
IList<int> Deveel.Data.Sql.Tables.FunctionTable.GetGroupRows |
( |
int |
groupNumber | ) |
|
|
inlineprivate |
Definition at line 199 of file FunctionTable.cs.
200 var rows =
new List<int>();
203 while ((row & 0x040000000) == 0) {
209 rows.Add(row & 0x03FFFFFFF);
int Deveel.Data.Sql.Tables.FunctionTable.GetGroupSize |
( |
int |
groupNumber | ) |
|
|
inlineprivate |
IList<int> Deveel.Data.Sql.Tables.FunctionTable.GetMaxFromEachGroup |
( |
int |
colNum | ) |
|
|
inlineprivate |
Definition at line 229 of file FunctionTable.cs.
232 var extractRows =
new List<int>();
235 int toTakeInGroup = -1;
236 DataObject max = null;
238 for (
int i = 0; i < size; ++i) {
241 int actRIndex = row & 0x03FFFFFFF;
242 var cell = refTab.GetValue(actRIndex, colNum);
244 if (max == null || cell.CompareTo(max) > 0) {
246 toTakeInGroup = actRIndex;
249 if ((row & 0x040000000) != 0) {
250 extractRows.Add(toTakeInGroup);
int Deveel.Data.Sql.Tables.FunctionTable.GetRowGroup |
( |
int |
rowIndex | ) |
|
|
inlineprivate |
IList<int> Deveel.Data.Sql.Tables.FunctionTable.GetTopRowsFromEachGroup |
( |
| ) |
|
|
inlineprivate |
Definition at line 213 of file FunctionTable.cs.
214 var extractRows =
new List<int>();
218 for (
int i = 0; i < size; ++i) {
221 extractRows.Add(r & 0x03FFFFFFF);
223 take = (r & 0x040000000) != 0;
override DataObject Deveel.Data.Sql.Tables.FunctionTable.GetValue |
( |
long |
rowNumber, |
|
|
int |
columnOffset |
|
) |
| |
|
inlinevirtual |
Gets a single cell within the table that is located at the given column offset and row.
- Parameters
-
rowNumber | The unique number of the row where the cell is located. |
columnOffset | The zero-based offset of the column of the cell to return. |
- Returns
- Returns an instance of DataObject that is contained in the cell located by the row and column coordinates provided.
- Exceptions
-
ArgumentOutOfRangeException | If the given columnOffset is less than zero or greater or equal than the number of columns defined in the table metadata. |
- See also
- Tables.TableInfo.IndexOfColumn(string)
Implements Deveel.Data.Sql.Tables.Table.
Definition at line 144 of file FunctionTable.cs.
150 if (
expInfo[columnOffset] == 0 && cache != null) {
157 return CalcValue((
int)rowNumber, columnOffset, cache);
161 return CalcValue((
int)rowNumber, columnOffset, null);
ITableCellCache TableCellCache()
ITransaction Transaction
Gets the instance of ITransaction that handles the transactional operations of this session...
DataObject CalcValue(int row, int column, ITableCellCache cache)
readonly IRequest context
override void Deveel.Data.Sql.Tables.FunctionTable.Lock |
( |
| ) |
|
|
inlinevirtual |
Definition at line 258 of file FunctionTable.cs.
266 rowList =
new List<int>(1);
267 var rowEnum = table.GetEnumerator();
268 if (rowEnum.MoveNext()) {
269 rowList.Add(rowEnum.Current.RowId.RowNumber);
275 rowList.Add(Int32.MaxValue - 1);
277 }
else if (table.RowCount == 0) {
278 rowList =
new List<int>(0);
282 if (maxColumn == null) {
296 var en = table.GetEnumerator();
297 while (en.MoveNext()) {
298 rowList.Add(en.Current.RowId.RowNumber);
305 var tabs =
new [] { table,
this };
306 var rowSets =
new[] { rowList, rowList };
308 return new VirtualTable(tabs, rowSets);
IList< int > GetMaxFromEachGroup(int colNum)
IList< int > GetTopRowsFromEachGroup()
static void Deveel.Data.Sql.Tables.FunctionTable.PlaceAt |
( |
IList< int > |
list, |
|
|
int |
index, |
|
|
int |
value |
|
) |
| |
|
inlinestaticprivate |
Definition at line 396 of file FunctionTable.cs.
397 while (index > list.Count) {
401 list.Insert(index, value);
override void Deveel.Data.Sql.Tables.FunctionTable.Release |
( |
| ) |
|
|
inlinevirtual |
Definition at line 404 of file FunctionTable.cs.
405 var exp =
new [] { expression };
406 var names =
new[] {
"result" };
409 return new SubsetColumnTable(table,
new[]{0},
new []{
new ObjectName(
"result") });
FunctionTable(SqlExpression[] functionList, string[] columnNames, IRequest queryContext)
readonly IRequest context
Definition at line 412 of file FunctionTable.cs.
static ITable ResultTable(IRequest context, SqlExpression expression)
Defines the base class for instances that represent SQL expression tree nodes.
static SqlConstantExpression Constant(object value)
readonly IRequest context
static ITable Deveel.Data.Sql.Tables.FunctionTable.ResultTable |
( |
IRequest |
context, |
|
|
int |
value |
|
) |
| |
|
inlinestatic |
Definition at line 416 of file FunctionTable.cs.
static ITable ResultTable(IRequest context, SqlExpression expression)
readonly IRequest context
readonly IRequest Deveel.Data.Sql.Tables.FunctionTable.context |
|
private |
readonly byte [] Deveel.Data.Sql.Tables.FunctionTable.expInfo |
|
private |
readonly SqlExpression [] Deveel.Data.Sql.Tables.FunctionTable.expList |
|
private |
readonly ObjectName Deveel.Data.Sql.Tables.FunctionTable.FunctionTableName = new ObjectName(null, "FUNCTIONTABLE") |
|
staticprivate |
readonly TableInfo Deveel.Data.Sql.Tables.FunctionTable.funTableInfo |
|
private |
IList<int> Deveel.Data.Sql.Tables.FunctionTable.groupLinks |
|
private |
IList<int> Deveel.Data.Sql.Tables.FunctionTable.groupLookup |
|
private |
readonly int Deveel.Data.Sql.Tables.FunctionTable.rowCount |
|
private |
readonly int Deveel.Data.Sql.Tables.FunctionTable.uniqueId |
|
private |
int Deveel.Data.Sql.Tables.FunctionTable.uniqueKeySeq = 0 |
|
staticprivate |
bool Deveel.Data.Sql.Tables.FunctionTable.wholeTableAsGroup |
|
private |
IList<int> Deveel.Data.Sql.Tables.FunctionTable.wholeTableGroup |
|
private |
int Deveel.Data.Sql.Tables.FunctionTable.wholeTableGroupSize |
|
private |
bool Deveel.Data.Sql.Tables.FunctionTable.wholeTableIsSimpleEnum |
|
private |
ITable Deveel.Data.Sql.Tables.FunctionTable.ReferenceTable |
|
getprivate set |
override int Deveel.Data.Sql.Tables.FunctionTable.RowCount |
|
get |
override TableInfo Deveel.Data.Sql.Tables.FunctionTable.TableInfo |
|
get |
The documentation for this class was generated from the following file:
- /var/calculate/remote/distfiles/egit-src/deveeldb.git/src/deveeldb/Deveel.Data.Sql.Tables/FunctionTable.cs