From 4fb38c16c2810e103431bf4b4fa6b91b80f188b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Pucha=C5=82a?= Date: Wed, 7 Feb 2024 22:55:53 +0100 Subject: [PATCH] Update README.md --- README.md | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 771c1e2f..64ba6491 100644 --- a/README.md +++ b/README.md @@ -62,22 +62,34 @@ The engine is compatible with Linux, Windows, and Docker environments. It is als ## Query examples -#### Get only files that extension is `.png` or `.jpg` +#### Use GPT to compute sentiment on a comment + +```sql +select + csv.PostId, + csv.Comment, + gpt.Sentiment(csv.Comment) as Sentiment, + csv.Date +from #separatedvalues.csv('/home/somebody/comments_sample.csv', true, 0) csv +inner join #openai.gpt('gpt-4-1106-preview') gpt on 1 = 1 ``` + +#### Get only files that extension is `.png` or `.jpg` +```sql SELECT FullName FROM #os.files('C:/Some/Path/To/Dir', true) WHERE Extension = '.png' OR Extension = '.jpg' ``` #### equivalent with `in` operator: -``` +```sql SELECT FullName FROM #os.files('C:/Some/Path/To/Dir', true) WHERE Extension IN ('.png', '.jpg') ``` #### group by directory and show size of each directories -``` +```sql SELECT DirectoryName, Sum(Length) / 1024 / 1024 as 'MB', @@ -88,14 +100,14 @@ FROM #os.files('', true) GROUP BY DirectoryName ``` #### try to find a file that has part `report` in his name: -``` +```sql SELECT * FROM #os.files('', true) WHERE Name like '%report%' ``` #### try to find a file that has in it's title word that sounds like: -``` +```sql SELECT FullName FROM #os.files('E:/', true) @@ -104,7 +116,7 @@ WHERE HasWordThatSoundLike(Name, 'material') ``` #### get first, last 5 bits from files and consecutive 10 bytes of file with offset of 5 from tail -``` +```sql SELECT ToHex(Head(5), '|'), ToHex(Tail(5), '|'), @@ -112,7 +124,7 @@ SELECT FROM #os.files('', false) ``` #### compare two directories -``` +```sql WITH filesOfA AS ( SELECT GetRelativeName('E:\DiffDirsTests\A') AS FullName, @@ -160,7 +172,7 @@ SELECT FROM inDestinationDir inDest ``` #### which basically equivalent with build-in plugin is: -``` +```sql SELECT ( CASE WHEN SourceFile IS NOT NULL @@ -177,7 +189,7 @@ SELECT FROM #os.dirscompare('E:\DiffDirsTests\A', 'E:\DiffDirsTests\B') ``` #### Look for directories contains zip files -``` +```sql SELECT DirectoryName, AggregateValues(Name) @@ -186,14 +198,14 @@ WHERE IsZipArchive() GROUP BY DirectoryName ``` #### Look for files greater than 1 gig -``` +```sql SELECT FullName FROM #os.files('', true) WHERE ToDecimal(Length) / 1024 / 1024 / 1024 > 1 ``` #### Tries to read the text from `.png` file through OCR plugin. -``` +```sql SELECT ocr.GetText(file.FullName) as text FROM @@ -204,7 +216,7 @@ ON 1 = 1 WHERE files.Extension = '.png' ``` #### Prints the values from 1 to 9 -``` +```sql SELECT Value FROM #system.range(1, 10) ```