sarthakmakhija / goselect Goto Github PK
View Code? Open in Web Editor NEWSQL like 'select' interface for files
License: GNU General Public License v2.0
SQL like 'select' interface for files
License: GNU General Public License v2.0
goselect supports regular expressions in a scalar function like. These regular expressions do not support group that means a function like like(name, ([0-9]?)([a-z]{1}))
does not work. This does not work because the goselect parser does not support parentheses inside a function.
goselect plans to use to delimit a group inside a regular expression. This means the above like function would be like(name, <g>[0-9]?</g><g>[a-z]{1}</g>)
Scope
ScalarFunctionBlock.go
. The first change must be replacing and inside like function with ( and ) respectively.FunctionExecutionCache
<G></g>
<G></G>
< g ><g />
< g>< g/>
< g>< g / >
Necessary details
Reference
Tokenizer.go
Provide support for "isArchive" scalar function. isArchive must take 1 parameter that is the mimeType. User can pass mimeType
attribute or any literal that represents a mimeType like text/plain
Example usage: isArchive(mimeType)
Sample queries for isArchive
select * from . where isArchive(mime)
select * from . where isArchive(mimeType)
Constraints
goselect
uses mime for determining the mime type of a fileapplication/x-7z-compressed
, application/zip
etc and also the mime types that are not considered as archiveNecessary details
Functions.go
ScalarFunctionBlock.go
Reference
ScalarFunctionBlock.go
isText
, isVideo
etcgoselect should run on Windows OS. At this point, goselect runs on MacOS and linux with ARM64, AMD64 and i386 processor.
One of the main challenges in ensuring that it runs on windows is the way golang exposes
user and group
information needs to be found in windowsblock
information needs to be found in windowshidden_windows.go already exists
)In order to provide support for windows we must make the following changes:
Changes
Reference
Provide support for "between" scalar function. Between must take 3 parameters, the one first is the attribute that needs to be compared against the second and the third parameter values.
Example usage: between(size, 100, 600)
indicates that the size must be between 100 and 600 bytes (both inclusive) for between to return true.
Sample queries for between
select * from . where between(size, 100, 600)
select * from . where between(size, parseSize(1 Mib), parseSize(5 Mib))
Constraints
between(size, 100, 10)
MUST throw an errorbetween(size, 10, hello)
MUST throw an errorbetween
with timestamp type values, with string, with numeric values and with values that can't be comparedNecessary details
Functions.go
ScalarFunctionBlock.go
Reference
ScalarFunctionBlock.go
Provide support for "contents" attribute. This attribute represents the contents of a file.
Sample queries using contents attribute
select * from . where like(contents, LengthFunctionBlock)
select * from . where like(contents, TrimFunctionBlock)
Constraints
AttributeLazyEvaluationBlock.go
to understand lazy evaluationFileAttributes
objectFileAttributes
objectNecessary details
Attributes.go
FileAttributes.go
acts as a wrapper over fileInfoReference
Attributes.go
and FileAttributes.go
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.