Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different schema view from inner query and outer query #17

Closed
michalwidera opened this issue Aug 2, 2020 · 10 comments
Closed

Different schema view from inner query and outer query #17

michalwidera opened this issue Aug 2, 2020 · 10 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@michalwidera
Copy link
Owner

When simple query is issued like:
select one[1],one[2] stream one from a
But second query that is issued
select one[1] stream two from one+a
Will give inporper position in schema.
one[1] from stream one should be different from one[1] from stream two.
Now this leads to ambigous situtaion and errors in system reposnes.
More exaples needed.

Proposed solution - different, inner schema for inner queries and outer schema for outer queries.

@michalwidera michalwidera added the bug Something isn't working label Aug 2, 2020
@michalwidera michalwidera self-assigned this Jul 13, 2021
@michalwidera michalwidera pinned this issue Jul 13, 2021
@michalwidera michalwidera added this to To do in retractordb Oct 8, 2021
@michalwidera michalwidera moved this from To do to In progress in retractordb Oct 9, 2021
@michalwidera
Copy link
Owner Author

refactor data storage

@michalwidera
Copy link
Owner Author

@michalwidera
Copy link
Owner Author

Work on ANTLR4.

  1. Work in stage area in Issue_17 branch
  2. Sucessfull PR in Conan.io repository
  3. Creating language from scratch ?

@michalwidera
Copy link
Owner Author

When simple query is issued like:
select one[1],one[2] stream one from a
But second query that is issued
select one[1] stream two from one+a

This shouldn't be allowed - this should appear as error.
Only:
select two[1] stream two from one+a
should be allowed

@michalwidera
Copy link
Owner Author

So far - issue_17 branch:

DECLARE a BYTE, b BYTE STREAM coreAB, 1 FILE '/dev/urandom'
DECLARE c BYTE, d BYTE STREAM coreCD, 0.5 FILE '/dev/urandom'

SELECT coreAB[0],coreAB[1],coreCD[0],coreCD[1] STREAM out1 FROM coreAB+coreCD
SELECT * STREAM out2 FROM coreAB+coreCD

Shows synchronized output

@michalwidera
Copy link
Owner Author

Issue_17 - dump

:STORAGE(0/1)   /home/michal/test/
out2(1/2)
        :- PUSH_STREAM(coreAB)
        :- PUSH_STREAM(coreCD)
        :- STREAM_ADD(0)
        Field_5:
                PUSH_ID(coreAB[0/1])
        Field_6:
                PUSH_ID(coreAB[1/1])
        Field_7:
                PUSH_ID(coreCD[0/1])
        Field_8:
                PUSH_ID(coreCD[1/1])
out1(1/2)
        :- PUSH_STREAM(coreAB)
        :- PUSH_STREAM(coreCD)
        :- STREAM_ADD(0)
        Field_0:
                PUSH_ID(coreAB[0/1])
        Field_1:
                PUSH_ID(coreAB[1/1])
        Field_2:
                PUSH_ID(coreCD[0/1])
        Field_3:
                PUSH_ID(coreCD[1/1])
coreCD(1/2)     /dev/urandom
        c:
        d:
coreAB(1/1)     /dev/urandom
        a:
        b:

@michalwidera
Copy link
Owner Author

Master dump:

coreCD(1/2)     '/dev/urandom'
        c:
        d:
out2(1/2)
        :- PUSH_STREAM(coreAB)
        :- PUSH_STREAM(coreCD)
        :- STREAM_ADD(0)
        Field_5:
                PUSH_ID(coreAB[0/1])
        Field_6:
                PUSH_ID(coreAB[1/1])
        Field_7:
                PUSH_ID(coreCD[0/1])
        Field_8:
                PUSH_ID(coreCD[1/1])
out1(1/2)
        :- PUSH_STREAM(coreAB)
        :- PUSH_STREAM(coreCD)
        :- STREAM_ADD(0)
        Field_0:
                PUSH_ID(coreAB[0/1])
        Field_1:
                PUSH_ID(coreAB[1/1])
        Field_2:
                PUSH_ID(coreCD[0/1])
        Field_3:
                PUSH_ID(coreCD[1/1])
coreAB(1/1)     '/dev/urandom'
        a:
        b:

This test case does not cover this issue properly.

@michalwidera
Copy link
Owner Author

Issue Explain Deatails
When we are testing folowing set of queries

DECLARE a BYTE, b BYTE STREAM core FROM 'data'
SELECT * STREAM p1 FROM core
SELECT a,b STREAM p2 FROM core
SELECT p3[0],p3[1] STREAM p3 FROM core

There is a problem with data picture seen from select or from outer source.
p2 is accessing directly from core and a,b elements are readed from core - but is should be readed from p2 context - materialized core from the given moment.
(here is this issue 17)
p3 currently does not compile - but it should.
We need full context from FROM clause with all the fields.
And query p2 and p3 sholuld read data from the context and not from core directly.
In a case of # opeartion problem is more important here.
Because there a,b could be ambigus and only context should remain accessible in SELECT clause algebraic operation list.

  • External/Outer query - that creates outer context should see SELECT clause list effects.

  • Internal computation from SELECT list should see full scan of FROM cluase context.

  • Context should be hold in memory ?

  • All result of SELECT clause opearions should remain on disk ?

@michalwidera
Copy link
Owner Author

update - "does not compile" - it compiles but executor fails here.

michalwidera added a commit that referenced this issue May 30, 2022
* Testing update

* Clean

* Adding interpreter

* Disable checking compiler

* Cmd

* terminal work

* Missing files

* Fixing

* Found bug - fixed

* Fixes

* Fixes

* Szlify interfesju

* Dump functionality

* Fixed last missed byte in read via fstream

* New layout

* Colors on termina

* Cleaning terminal

* Fix ut and cleaning Buffer before kick off

* xrdb fixes

* Float and Double - intro

* Set status in terminal:

* Payload correct form of template

* Architectural change

* Fixes

* Reverse iterator support

* Fixes

* Fixes on help

* Return values of get/set

* Missing template materialization

* Fast access enabled

* Revert "Fast access enabled"

This reverts commit 5d06fca.

* Cmake

* Permanent posix desciptor - object

* Byte array added

* Byte array

* Fix help in terminal

* Readme for rdb

* Update of readme

* Kicking out CBuffer

* Changes - prep kick off

* Revert to get proper dsp example

* Fix for conflicting name

* Fix

* CI update and ut name change

* CI update - fix

* Update README.md

conflicting xrdb name fix

* Add description of RDB in UML

* UML fix

* UML desc

* Markdown show

* Diagram in MD - Show

* Fail on merge support

* revert

* dir struct

* UML of xtrdb and clean of main.cpp of xtrdb

* Typos

* First working POC w/o CBuffer

* Remove of CBuffer

* Fixes in Readme, Cleaning legacy cbuff

* Remove of unused dump function

* Description of methods.
Cleaning.

* Encasuplation process

* Encapsulation

* Code quality fixes

* Embold suppres

* Code quality changes

* Parser atempt

* Staging of ANTLR4

* Antlr4 conan depenecy is on

* Change scope of Embold analysis.

Parser is code generated
Stage is Staging area not for production
Scripts are coming back - they are solid part of code.

* G4 - work on grammar

* Obsolete readme

* Work on parser

* Work on new parser

* Parser work

* Add new type

* Fix

* Extend test area

* fix on rdb

* Regressiont test on xtrdb

* x is ignored

* Work on Parser

* Work on parser

* Fix on call string

* Work on parser

* xrdb failure catch

* Adding error support in parser

* Listener aproach to parser

* Removing unused visitor - remain listener

* Enumeratation inside listener

* work on parser

* work on json

* Typo

* Fix generator

* Put changes

* Conflict marker remove

* Work on parser

* cat on conan profile

* working

* Syntax error drops out

* Work

* fix - no more conan source step

* Work

* Work

* Mandatory filename on declare

* Work with book

* Move of coreInstance into qstruct cpp

* Work on parser

* Work on compiler

* Astyle support

* Work on compiler

* Astyle

* case insnsitve keywords

* example 5 - similar

* work on type definitions

* RQL work on types

* Work on rdb unification

* Cleaning not used parser part

* Fix on readme

* Fix on funtion call

* examples compatible with old parser

* Add agse support

* Cover all examples

* Fixing bug in compiler affects UT pattern sequence

* astyle

* Polishing

* Move stage into compiler

* Change cpp into regression

* Fix on mod/div streams operators

* Astyle whole

* Remove unused class

* Parser add to embold

* Exclude generated code by antlr form embold

* Additional pattern covering Agse

* fix on config.yml

* Fix on config yaml

* Fix on config yaml

* Update conanfile.py

* Update config.yml

* Update config.yml

* Work in conan

* Set default options

* Prepare for Antlr4 - 4.10

* Fix for option parameter via conan install .. -o antlr4=4.10

* Antlr4.10.1

* Issue 17 - cover pattern

* Add storage parameter - no support yet

* Change time of testing branch

* Cut off legacy non used code

* Add rdb into astyle and path support

* Fix for wrong resource storage allocation

* Used cmake format

* CLang support

* Add clang to ci

* Work on clang force

* fix for clang ci

* Build missing parts on clang conan profile

* large resource

* Move clang edge build to nightly

* issue 17 - work on core problem

* Build compiler signature included in executable

* Add astyle for cmake

* Smoke test

* Make config line more convinient

* Fix for vim and exmaple that fails on #17

* Fix on log line

* Remove namespace contamination from header

* Remove std dependency from processor.cpp

* Removing std deps

* Ugly bug with parsing types mismatch - catched on plot-simple

* Appearently dsp algo works fine!

* Remove config.h from version control

* remove config.h from version control

* Trying to remove

* remove redunant git ignore files

* Modify gitignore

* Clean

* Remove std contamination

* Remove std contamination

* Missing .antl ignore

* Remove astyle from Parser generator result

* Fix for missing = in make astyle

* Polishing bash scripts

* Remove rest of std contaminated code

* full scan of cmakes

* Make more relative paths in main cmake

* Try include antlr into CI

* 2nd attepmpt

* Handle of std::system result from Dot

* Set default mode to JSON

* Remove unused test

* Storage for examples

* Remove one step in edge ci

* gitignore - work on temp

* Lambdas in loops

* 20 req

* Force c++20 in 9.4 compiler

* Fix for 2.0

* Fix for 2.0

* Revert of C++20 features

* Trying gcc 10 instead of 9.4 on CI

* Fix

* Trying to purge 4.9 from edge

* Trying to purge 4.9 from edge

* Removing redundant method of ipc communication

* change result of getblock from int to bool

* Bump boost version

* get into readData

* Added type desciption into xdumper

* Refactor - remove rendunant call

* Fix dumper

* Build timestamp

* Refactor of dbstream.* files

* testing

* Remove ugly enum generator with something more maintainable

* Fix astyle

* Identation of defines and incorporation of define in tokenDef.h

* eType same as tokens

* new line missing

* brackets on vectors

* cformat intro

* Fix clang

* if cascade to swtich case pattern

* cformat

* Definitions name fix

* Unifiy types stage 1

* String to STRING

* Unifiy types stage 2

* Unifiy types stage 3

* Unifiy types stage 4

* cformat

* fix on idnet

* Fix on GetFieldType

* tuple serialization

* Remove nameset

* remove of fieldName from field

* remove of dFieldType and use fieldDesc

* Purge fetFirstFieldName function

* work on schema

* Work

* Remove ununsed function
michalwidera added a commit that referenced this issue Feb 27, 2023
* Testing update

* Clean

* Adding interpreter

* Disable checking compiler

* Cmd

* terminal work

* Missing files

* Fixing

* Found bug - fixed

* Fixes

* Fixes

* Szlify interfesju

* Dump functionality

* Fixed last missed byte in read via fstream

* New layout

* Colors on termina

* Cleaning terminal

* Fix ut and cleaning Buffer before kick off

* xrdb fixes

* Float and Double - intro

* Set status in terminal:

* Payload correct form of template

* Architectural change

* Fixes

* Reverse iterator support

* Fixes

* Fixes on help

* Return values of get/set

* Missing template materialization

* Fast access enabled

* Revert "Fast access enabled"

This reverts commit 5d06fca.

* Cmake

* Permanent posix desciptor - object

* Byte array added

* Byte array

* Fix help in terminal

* Readme for rdb

* Update of readme

* Kicking out CBuffer

* Changes - prep kick off

* Revert to get proper dsp example

* Fix for conflicting name

* Fix

* CI update and ut name change

* CI update - fix

* Update README.md

conflicting xrdb name fix

* Add description of RDB in UML

* UML fix

* UML desc

* Markdown show

* Diagram in MD - Show

* Fail on merge support

* revert

* dir struct

* UML of xtrdb and clean of main.cpp of xtrdb

* Typos

* First working POC w/o CBuffer

* Remove of CBuffer

* Fixes in Readme, Cleaning legacy cbuff

* Remove of unused dump function

* Description of methods.
Cleaning.

* Encasuplation process

* Encapsulation

* Code quality fixes

* Embold suppres

* Code quality changes

* Parser atempt

* Staging of ANTLR4

* Antlr4 conan depenecy is on

* Change scope of Embold analysis.

Parser is code generated
Stage is Staging area not for production
Scripts are coming back - they are solid part of code.

* G4 - work on grammar

* Obsolete readme

* Work on parser

* Work on new parser

* Parser work

* Add new type

* Fix

* Extend test area

* fix on rdb

* Regressiont test on xtrdb

* x is ignored

* Work on Parser

* Work on parser

* Fix on call string

* Work on parser

* xrdb failure catch

* Adding error support in parser

* Listener aproach to parser

* Removing unused visitor - remain listener

* Enumeratation inside listener

* work on parser

* work on json

* Typo

* Fix generator

* Put changes

* Conflict marker remove

* Work on parser

* cat on conan profile

* working

* Syntax error drops out

* Work

* fix - no more conan source step

* Work

* Work

* Mandatory filename on declare

* Work with book

* Move of coreInstance into qstruct cpp

* Work on parser

* Work on compiler

* Astyle support

* Work on compiler

* Astyle

* case insnsitve keywords

* example 5 - similar

* work on type definitions

* RQL work on types

* Work on rdb unification

* Cleaning not used parser part

* Fix on readme

* Fix on funtion call

* examples compatible with old parser

* Add agse support

* Cover all examples

* Fixing bug in compiler affects UT pattern sequence

* astyle

* Polishing

* Move stage into compiler

* Change cpp into regression

* Fix on mod/div streams operators

* Astyle whole

* Remove unused class

* Parser add to embold

* Exclude generated code by antlr form embold

* Additional pattern covering Agse

* fix on config.yml

* Fix on config yaml

* Fix on config yaml

* Update conanfile.py

* Update config.yml

* Update config.yml

* Work in conan

* Set default options

* Prepare for Antlr4 - 4.10

* Fix for option parameter via conan install .. -o antlr4=4.10

* Antlr4.10.1

* Issue 17 - cover pattern

* Add storage parameter - no support yet

* Change time of testing branch

* Cut off legacy non used code

* Add rdb into astyle and path support

* Fix for wrong resource storage allocation

* Used cmake format

* CLang support

* Add clang to ci

* Work on clang force

* fix for clang ci

* Build missing parts on clang conan profile

* large resource

* Move clang edge build to nightly

* issue 17 - work on core problem

* Build compiler signature included in executable

* Add astyle for cmake

* Smoke test

* Make config line more convinient

* Fix for vim and exmaple that fails on #17

* Fix on log line

* Remove namespace contamination from header

* Remove std dependency from processor.cpp

* Removing std deps

* Ugly bug with parsing types mismatch - catched on plot-simple

* Appearently dsp algo works fine!

* Remove config.h from version control

* remove config.h from version control

* Trying to remove

* remove redunant git ignore files

* Modify gitignore

* Clean

* Remove std contamination

* Remove std contamination

* Missing .antl ignore

* Remove astyle from Parser generator result

* Fix for missing = in make astyle

* Polishing bash scripts

* Remove rest of std contaminated code

* full scan of cmakes

* Make more relative paths in main cmake

* Try include antlr into CI

* 2nd attepmpt

* Handle of std::system result from Dot

* Set default mode to JSON

* Remove unused test

* Storage for examples

* Remove one step in edge ci

* gitignore - work on temp

* Lambdas in loops

* 20 req

* Force c++20 in 9.4 compiler

* Fix for 2.0

* Fix for 2.0

* Revert of C++20 features

* Trying gcc 10 instead of 9.4 on CI

* Fix

* Trying to purge 4.9 from edge

* Trying to purge 4.9 from edge

* Removing redundant method of ipc communication

* change result of getblock from int to bool

* Bump boost version

* get into readData

* Added type desciption into xdumper

* Refactor - remove rendunant call

* Fix dumper

* Build timestamp

* Refactor of dbstream.* files

* testing

* Remove ugly enum generator with something more maintainable

* Fix astyle

* Identation of defines and incorporation of define in tokenDef.h

* eType same as tokens

* new line missing

* brackets on vectors

* cformat intro

* Fix clang

* if cascade to swtich case pattern

* cformat

* Definitions name fix

* Unifiy types stage 1

* String to STRING

* Unifiy types stage 2

* Unifiy types stage 3

* Unifiy types stage 4

* cformat

* fix on idnet

* Fix on GetFieldType

* tuple serialization

* Remove nameset

* remove of fieldName from field

* remove of dFieldType and use fieldDesc

* Purge fetFirstFieldName function

* work on schema

* Work

* Remove ununsed function
michalwidera added a commit that referenced this issue Feb 28, 2023
* Testing update

* Clean

* Adding interpreter

* Disable checking compiler

* Cmd

* terminal work

* Missing files

* Fixing

* Found bug - fixed

* Fixes

* Fixes

* Szlify interfesju

* Dump functionality

* Fixed last missed byte in read via fstream

* New layout

* Colors on termina

* Cleaning terminal

* Fix ut and cleaning Buffer before kick off

* xrdb fixes

* Float and Double - intro

* Set status in terminal:

* Payload correct form of template

* Architectural change

* Fixes

* Reverse iterator support

* Fixes

* Fixes on help

* Return values of get/set

* Missing template materialization

* Fast access enabled

* Revert "Fast access enabled"

This reverts commit 5d06fca.

* Cmake

* Permanent posix desciptor - object

* Byte array added

* Byte array

* Fix help in terminal

* Readme for rdb

* Update of readme

* Kicking out CBuffer

* Changes - prep kick off

* Revert to get proper dsp example

* Fix for conflicting name

* Fix

* CI update and ut name change

* CI update - fix

* Update README.md

conflicting xrdb name fix

* Add description of RDB in UML

* UML fix

* UML desc

* Markdown show

* Diagram in MD - Show

* Fail on merge support

* revert

* dir struct

* UML of xtrdb and clean of main.cpp of xtrdb

* Typos

* First working POC w/o CBuffer

* Remove of CBuffer

* Fixes in Readme, Cleaning legacy cbuff

* Remove of unused dump function

* Description of methods.
Cleaning.

* Encasuplation process

* Encapsulation

* Code quality fixes

* Embold suppres

* Code quality changes

* Parser atempt

* Staging of ANTLR4

* Antlr4 conan depenecy is on

* Change scope of Embold analysis.

Parser is code generated
Stage is Staging area not for production
Scripts are coming back - they are solid part of code.

* G4 - work on grammar

* Obsolete readme

* Work on parser

* Work on new parser

* Parser work

* Add new type

* Fix

* Extend test area

* fix on rdb

* Regressiont test on xtrdb

* x is ignored

* Work on Parser

* Work on parser

* Fix on call string

* Work on parser

* xrdb failure catch

* Adding error support in parser

* Listener aproach to parser

* Removing unused visitor - remain listener

* Enumeratation inside listener

* work on parser

* work on json

* Typo

* Fix generator

* Put changes

* Conflict marker remove

* Work on parser

* cat on conan profile

* working

* Syntax error drops out

* Work

* fix - no more conan source step

* Work

* Work

* Mandatory filename on declare

* Work with book

* Move of coreInstance into qstruct cpp

* Work on parser

* Work on compiler

* Astyle support

* Work on compiler

* Astyle

* case insnsitve keywords

* example 5 - similar

* work on type definitions

* RQL work on types

* Work on rdb unification

* Cleaning not used parser part

* Fix on readme

* Fix on funtion call

* examples compatible with old parser

* Add agse support

* Cover all examples

* Fixing bug in compiler affects UT pattern sequence

* astyle

* Polishing

* Move stage into compiler

* Change cpp into regression

* Fix on mod/div streams operators

* Astyle whole

* Remove unused class

* Parser add to embold

* Exclude generated code by antlr form embold

* Additional pattern covering Agse

* fix on config.yml

* Fix on config yaml

* Fix on config yaml

* Update conanfile.py

* Update config.yml

* Update config.yml

* Work in conan

* Set default options

* Prepare for Antlr4 - 4.10

* Fix for option parameter via conan install .. -o antlr4=4.10

* Antlr4.10.1

* Issue 17 - cover pattern

* Add storage parameter - no support yet

* Change time of testing branch

* Cut off legacy non used code

* Add rdb into astyle and path support

* Fix for wrong resource storage allocation

* Used cmake format

* CLang support

* Add clang to ci

* Work on clang force

* fix for clang ci

* Build missing parts on clang conan profile

* large resource

* Move clang edge build to nightly

* issue 17 - work on core problem

* Build compiler signature included in executable

* Add astyle for cmake

* Smoke test

* Make config line more convinient

* Fix for vim and exmaple that fails on #17

* Fix on log line

* Remove namespace contamination from header

* Remove std dependency from processor.cpp

* Removing std deps

* Ugly bug with parsing types mismatch - catched on plot-simple

* Appearently dsp algo works fine!

* Remove config.h from version control

* remove config.h from version control

* Trying to remove

* remove redunant git ignore files

* Modify gitignore

* Clean

* Remove std contamination

* Remove std contamination

* Missing .antl ignore

* Remove astyle from Parser generator result

* Fix for missing = in make astyle

* Polishing bash scripts

* Remove rest of std contaminated code

* full scan of cmakes

* Make more relative paths in main cmake

* Try include antlr into CI

* 2nd attepmpt

* Handle of std::system result from Dot

* Set default mode to JSON

* Remove unused test

* Storage for examples

* Remove one step in edge ci

* gitignore - work on temp

* Lambdas in loops

* 20 req

* Force c++20 in 9.4 compiler

* Fix for 2.0

* Fix for 2.0

* Revert of C++20 features

* Trying gcc 10 instead of 9.4 on CI

* Fix

* Trying to purge 4.9 from edge

* Trying to purge 4.9 from edge

* Removing redundant method of ipc communication

* change result of getblock from int to bool

* Bump boost version

* get into readData

* Added type desciption into xdumper

* Refactor - remove rendunant call

* Fix dumper

* Build timestamp

* Refactor of dbstream.* files

* testing

* Remove ugly enum generator with something more maintainable

* Fix astyle

* Identation of defines and incorporation of define in tokenDef.h

* eType same as tokens

* new line missing

* brackets on vectors

* cformat intro

* Fix clang

* if cascade to swtich case pattern

* cformat

* Definitions name fix

* Unifiy types stage 1

* String to STRING

* Unifiy types stage 2

* Unifiy types stage 3

* Unifiy types stage 4

* cformat

* fix on idnet

* Fix on GetFieldType

* tuple serialization

* Remove nameset

* remove of fieldName from field

* remove of dFieldType and use fieldDesc

* Purge fetFirstFieldName function

* work on schema

* Work

* Remove ununsed function
@michalwidera
Copy link
Owner Author

Done.

@michalwidera michalwidera moved this from In progress to Done in retractordb Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

1 participant