Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a5d30081
Commit
a5d30081
authored
Apr 04, 2016
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove no longer used Window_context class.
parent
629f9fea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
89 deletions
+3
-89
sql/item_windowfunc.h
sql/item_windowfunc.h
+3
-89
No files found.
sql/item_windowfunc.h
View file @
a5d30081
...
...
@@ -227,95 +227,9 @@ class Item_sum_dense_rank: public Item_sum_int
}
};
/* TODO-cvicentiu
* Perhaps this is overengineering, but I would like to decouple the 2-pass
* algorithm from the specific action that must be performed during the
* first pass. The second pass can make use of the "add" function from the
* Item_sum_<window_function>.
*/
/*
This class represents a generic interface for window functions that need
to store aditional information. Such window functions include percent_rank
and cume_dist.
*/
class
Window_context
{
public:
virtual
void
add_field_to_context
(
Field
*
field
)
=
0
;
virtual
void
reset
()
=
0
;
virtual
~
Window_context
()
{};
};
/*
A generic interface that specifies the datatype that the context represents.
*/
template
<
typename
T
>
class
Window_context_getter
{
protected:
virtual
T
get_field_context
(
const
Field
*
field
)
=
0
;
virtual
~
Window_context_getter
()
{};
};
/*
A window function context representing the number of rows that are present
with a partition. Because the number of rows is not dependent of the
specific value within the current field, we ignore the parameter
in this case.
*/
class
Window_context_row_count
:
public
Window_context
,
Window_context_getter
<
ulonglong
>
{
public:
Window_context_row_count
()
:
num_rows_
(
0
)
{};
void
add_field_to_context
(
Field
*
field
__attribute__
((
unused
)))
{
num_rows_
++
;
}
void
reset
()
{
num_rows_
=
0
;
}
ulonglong
get_field_context
(
const
Field
*
field
__attribute__
((
unused
)))
{
return
num_rows_
;
}
private:
ulonglong
num_rows_
;
};
class
Window_context_row_and_group_count
:
public
Window_context
,
Window_context_getter
<
std
::
pair
<
ulonglong
,
ulonglong
>
>
{
public:
Window_context_row_and_group_count
(
void
*
group_list
)
{}
};
/*
An abstract class representing an item that holds a context.
*/
class
Item_context
{
public:
Item_context
()
:
context_
(
NULL
)
{}
Window_context
*
get_window_context
()
{
return
context_
;
}
virtual
bool
create_window_context
()
=
0
;
virtual
void
delete_window_context
()
=
0
;
protected:
Window_context
*
context_
;
};
/*
A base window function (aggregate) that also holds a context.
NOTE: All two pass window functions need to implement
this interface.
A base window function (aggregate) that also holds a counter for the number
of rows.
*/
class
Item_sum_window_with_row_count
:
public
Item_sum_num
{
...
...
@@ -451,7 +365,7 @@ class Item_sum_cume_dist: public Item_sum_window_with_row_count
return
false
;
}
enum
Sumfunctype
sum_func
()
const
enum
Sumfunctype
sum_func
()
const
{
return
CUME_DIST_FUNC
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment