Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 588af01

Browse files
Replaced CASE with IF
1 parent e6950ed commit 588af01

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jbang-wrapper/.jbang/**
2-
data/**
2+
mariadb-data/**
33
models/**
44

55
.vscode

‎RagDemo.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private static String getContext(String input) throws JsonProcessingException {
4949
var table = connection.createQuery("""
5050
SELECT id, CONCAT(
5151
"Product: ", title, ". Stars: ", stars, ". Price: $", price, ". Category: ", category_name,
52-
". Best seller: ", CASE WHEN is_best_seller THEN "Yes" ELSE "No" END
52+
". Best seller: ", IF(is_best_seller, "Yes", "No")
5353
) AS description
5454
FROM products
5555
WHERE embedding IS NOT NULL

‎UpdateVectors.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static void main(String[] args) throws Exception {
2020
var table = connection.createQuery("""
2121
SELECT id, CONCAT(
2222
"Product: ", title, ". Stars: ", stars, ". Price: $", price, ". Category: ", category_name,
23-
". Best seller: ", CASE WHEN is_best_seller THEN "Yes" ELSE "No" END
23+
". Best seller: ", IF(is_best_seller, "Yes", "No")
2424
) AS description
2525
FROM products
2626
WHERE embedding IS NULL

‎docker-compose.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
MARIADB_DATABASE: demo
88
volumes:
99
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
10-
- ./data:/var/lib/mysql
10+
- ./mariadb-data:/var/lib/mysql
1111
ports:
1212
- "3306:3306"
1313

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /