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

Introduce an attribute "contents" #4

Open
SarthakMakhija opened this issue Sep 27, 2022 · 2 comments
Open

Introduce an attribute "contents" #4

SarthakMakhija opened this issue Sep 27, 2022 · 2 comments
Labels
hacktoberfest help wanted Extra attention is needed

Comments

@SarthakMakhija
Copy link
Owner

SarthakMakhija commented Sep 27, 2022

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

  1. contents MUST be a lazily evaluated attribute. Refer AttributeLazyEvaluationBlock.go to understand lazy evaluation
  2. Once contents is evaluated it must be set in FileAttributes object
  3. contents MUST be evaluated only for text files
  4. contents MUST be evaluated only for text files if the size is less than 20 Mib, else set an empty string in FileAttributes object
  5. Add tests to cover evaluation of contents at least for text files, hidden files that are text files, an image file, a doc and a pdf file

Necessary details

  1. New attributes are onboarded in Attributes.go
  2. FileAttributes.go acts as a wrapper over fileInfo

Reference

  1. Refer mimeType attribute for lazy evaluation in Attributes.go and FileAttributes.go
@SarthakMakhija SarthakMakhija changed the title Introduce an attribute "contents" Introduce a scalar function "fileContains" Sep 27, 2022
@SarthakMakhija SarthakMakhija added the help wanted Extra attention is needed label Sep 27, 2022
@SarthakMakhija SarthakMakhija changed the title Introduce a scalar function "fileContains" Introduce an attribute "contents" Sep 27, 2022
@PankhudiB
Copy link

Hello, can I work on this under Hacktoberfest'22 ?

@SarthakMakhija
Copy link
Owner Author

Hey @PankhudiB

This issue has already been picked by someone .. If you are want, you may take a look at this and see if this interests you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants