Skip to content

Conversation

galogm
Copy link

@galogm galogm commented Sep 8, 2025

Error:
no old_product_name_token found

Description of changes:
add product_name_token from expert schema

Could you please confirm if this fix is correct?
If not, where should I look for the missing old_product_name_token in the query below?
Thanks a lot!
image

@CurryTang
Copy link
Collaborator

Hi, since we are using duckdb here, line 1191 will actually give you access to table old_product_name_token here, so this shouldn't be a problem

@galogm
Copy link
Author

galogm commented Sep 9, 2025

@CurryTang Thank you for the quick reply!

However, when running preprocessing_dataset.py for the diginetica dataset, the script fails with a duckdb.CatalogException. The error indicates that the table old_product_name_token does not exist:

# blabla...
100%|██████████| 320M/320M [00:33<00:00, 9.47MB/s]
[I][2025-09-09 19:59:22,download.py:144] Extracting data/diginetica/raw/20240304-diginetica.tar ...
[I][2025-09-09 19:59:23,builtin_dataset.py:33] Dataset downloaded to 'data/diginetica/raw/diginetica'.
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /graph/xxx/projects/Automatic-Table-to-Graph-Generation/main/preprocessin │
│ g_dataset.py:1206 in main                                                    │
│                                                                              │
│   1203 │   │   #     ON np.itemId = opt.itemId                               │
│   1204 │   │   #     GROUP BY np.itemId, np.categoryId, np.pricelog2         │
│   1205 │   │   # """)                                                        │
│ ❱ 1206 │   │   new_product = duckdb.query("""                                │
│   1207 │   │   │   SELECT np.itemId,                                         │
│   1208 │   │   │   │   np.categoryId,                                        │
│   1209 │   │   │   │   np.pricelog2,                                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │                        dataset = 'diginetica'                            │ │
│ │                   dataset_path = 'data'                                  │ │
│ │                      new_click = │   │    queryId  itemId                │ │
│ │                                  timestamp                               │ │
│ │                                  0              1   24857 2016-05-09     │ │
│ │                                  20:27:02.181                            │ │
│ │                                  1          46255   30792 2016-05-09     │ │
│ │                                  20:28:08.232                            │ │
│ │                                  2          46689    8252 2016-05-09     │ │
│ │                                  16:58:35.268                            │ │
│ │                                  3          46731   33969 2016-05-09     │ │
│ │                                  20:25:56.888                            │ │
│ │                                  4          46748    7837 2016-05-09     │ │
│ │                                  17:02:21.813                            │ │
│ │                                  ...          ...     ...                │ │
│ │                                  ...                                     │ │
│ │                                  1127759   980493   42906 2016-04-14     │ │
│ │                                  19:45:16.918                            │ │
│ │                                  1127760   980493   33312 2016-04-14     │ │
│ │                                  19:45:27.425                            │ │
│ │                                  1127761   980493   33312 2016-04-14     │ │
│ │                                  19:35:35.050                            │ │
│ │                                  1127762   980493    5227 2016-04-14     │ │
│ │                                  19:44:19.554                            │ │
│ │                                  1127763   980503   13296 2016-02-16     │ │
│ │                                  03:58:32.055                            │ │
│ │                                                                          │ │
│ │                                  [1127764 rows x 3 columns]              │ │
│ │                    new_product = │   │   itemId  categoryId  pricelog2   │ │
│ │                                  0       139578        1096          0   │ │
│ │                                  1       417975        1096          0   │ │
│ │                                  2       291805        1096          0   │ │
│ │                                  3       396921        1096          0   │ │
│ │                                  4       159257        1096          0   │ │
│ │                                  ...        ...         ...        ...   │ │
│ │                                  184042  384760         527          7   │ │
│ │                                  184043  386702         527          6   │ │
│ │                                  184044  384854         527          6   │ │
│ │                                  184045  128776         654          0   │ │
│ │                                  184046  128777         654          6   │ │
│ │                                                                          │ │
│ │                                  [184047 rows x 3 columns]               │ │
│ │                   new_purchase = │      purchase_session  purchaser      │ │
│ │                                  ordernumber  itemId                     │ │
│ │                                  timestamp                               │ │
│ │                                  0                   150    18278.0      │ │
│ │                                  16421   25911 2016-05-06 05:42:32.820   │ │
│ │                                  1                   151        NaN      │ │
│ │                                  16290  175874 2016-05-06 02:21:59.832   │ │
│ │                                  2                   156        7.0      │ │
│ │                                  21173   35324 2016-06-16 16:19:09.736   │ │
│ │                                  3                   179        NaN      │ │
│ │                                  16924   31233 2016-05-09 15:28:48.713   │ │
│ │                                  4                   246       34.0      │ │
│ │                                  16936   34677 2016-05-09 04:42:46.525   │ │
│ │                                  ...                 ...        ...      │ │
│ │                                  ...     ...                     ...     │ │
│ │                                  18020            600131        NaN      │ │
│ │                                  5675   40804 2016-03-18 06:10:06.463    │ │
│ │                                  18021            600250        NaN      │ │
│ │                                  19629   33777 2016-05-21 18:37:20.278   │ │
│ │                                  18022            600432        NaN      │ │
│ │                                  13928   17176 2016-04-25 09:36:30.154   │ │
│ │                                  18023            600432        NaN      │ │
│ │                                  13928   13662 2016-04-25 09:36:30.154   │ │
│ │                                  18024            600661        NaN      │ │
│ │                                  18363  379345 2016-05-15 08:02:06.036   │ │
│ │                                                                          │ │
│ │                                  [18025 rows x 5 columns]                │ │
│ │                      new_query = │   │   queryId  query_sessionId  ...   │ │
│ │                                  categoryId               timestamp      │ │
│ │                                  0             1                1  ...   │ │
│ │                                  0 2016-05-09 20:26:50.394               │ │
│ │                                  1         46255                1  ...   │ │
│ │                                  0 2016-05-09 20:28:00.000               │ │
│ │                                  2         46689                1  ...   │ │
│ │                                  0 2016-05-09 16:57:55.835               │ │
│ │                                  3         46731                1  ...   │ │
│ │                                  0 2016-05-09 20:24:52.144               │ │
│ │                                  4         46748                1  ...   │ │
│ │                                  0 2016-05-09 17:02:10.871               │ │
│ │                                  ...         ...              ...  ...   │ │
│ │                                  ...                     ...             │ │
│ │                                  923119   980488           600681  ...   │ │
│ │                                  1121 2016-04-07 20:10:38.903            │ │
│ │                                  923121   980490           600683  ...   │ │
│ │                                  724 2016-03-25 12:43:55.106             │ │
│ │                                  923122   980492           173679  ...   │ │
│ │                                  981 2016-05-07 13:47:03.536             │ │
│ │                                  923123   980493           600684  ...   │ │
│ │                                  974 2016-04-14 19:34:46.022             │ │
│ │                                  923126   980503           600687  ...   │ │
│ │                                  305 2016-02-16 03:56:19.192             │ │
│ │                                                                          │ │
│ │                                  [636160 rows x 6 columns]               │ │
│ │               new_query_result = │   │   queryId  itemId                 │ │
│ │                                  timestamp                               │ │
│ │                                  0             1    7518 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1      71 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1   30311 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1    7837 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1   30792 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  ...         ...     ...                 │ │
│ │                                  ...                                     │ │
│ │                                  923126   980503   57719 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503   13296 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503   29388 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503  158860 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503  126076 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                                                          │ │
│ │                                  [92271275 rows x 3 columns]             │ │
│ │ new_query_search_string_tokens = │      queryId search_token             │ │
│ │                                  0            1        16655             │ │
│ │                                  0            1       244087             │ │
│ │                                  0            1        51531             │ │
│ │                                  0            1       529597             │ │
│ │                                  0            1        58153             │ │
│ │                                  ...        ...          ...             │ │
│ │                                  81606    53450       296114             │ │
│ │                                  81607    53452       528937             │ │
│ │                                  81609    53453         5742             │ │
│ │                                  81609    53453       146356             │ │
│ │                                  81609    53453        41709             │ │
│ │                                                                          │ │
│ │                                  [138260 rows x 2 columns]               │ │
│ │                       new_view = │   │    view_session  view_user        │ │
│ │                                  itemId               timestamp          │ │
│ │                                  0                   1        NaN        │ │
│ │                                  81766 2016-05-09 16:03:29.629           │ │
│ │                                  1                   1        NaN        │ │
│ │                                  31331 2016-05-09 16:11:54.338           │ │
│ │                                  2                   1        NaN        │ │
│ │                                  32118 2016-05-09 15:58:46.889           │ │
│ │                                  3                   1        NaN        │ │
│ │                                  9654 2016-05-09 15:55:59.168            │ │
│ │                                  4                   1        NaN        │ │
│ │                                  32627 2016-05-09 16:13:15.728           │ │
│ │                                  ...               ...        ...        │ │
│ │                                  ...                     ...             │ │
│ │                                  1235375        600684        NaN        │ │
│ │                                  42906 2016-04-14 19:45:18.875           │ │
│ │                                  1235376        600684        NaN        │ │
│ │                                  33312 2016-04-14 19:45:29.544           │ │
│ │                                  1235377        600684        NaN        │ │
│ │                                  33312 2016-04-14 19:35:38.643           │ │
│ │                                  1235378        600684        NaN        │ │
│ │                                  5227 2016-04-14 19:44:21.298            │ │
│ │                                  1235379        600687   249347.0        │ │
│ │                                  13296 2016-02-16 03:58:34.480           │ │
│ │                                                                          │ │
│ │                                  [1235380 rows x 4 columns]              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
CatalogException: Catalog Error: Table with name old_product_name_token does not
exist!
Did you mean "pg_constraint"?

No table named old_product_name_token was found in the downloaded data:
image

Am I missing something?

I am using duckdb==1.3.2. The downloading scripts are:

dataset_path=data
export DBB_DATASET_HOME=$dataset_path/diginetica/raw
export DBB_PROJECT_HOME=$dataset_path
mkdir -p "$dataset_path/diginetica/raw"
mkdir -p "$dataset_path/diginetica/old"
mkdir -p "$dataset_path/diginetica/expert"
mkdir -p "$dataset_path/diginetica/old/data"
mkdir -p "$dataset_path/diginetica/expert/data"
mkdir -p "$dataset_path/diginetica/old/ctr"
mkdir -p "$dataset_path/diginetica/expert/ctr"
mkdir -p "$dataset_path/diginetica/old/purchase"
mkdir -p "$dataset_path/diginetica/expert/purchase"
python3 -u -m dbinfer.main download diginetica
python3 -u -m main.preprocessing_dataset diginetica

@CurryTang
Copy link
Collaborator

Oh, I see the problem, we should use duckdb.sql instead of duckdb.query here. It should fix the problem and later we will release a new version

duckdb.sql("XXX").df()

@galogm
Copy link
Author

galogm commented Sep 10, 2025

@CurryTang Same error with duckdb.sql("XXX").df():

new_product = duckdb.sql("""
    SELECT np.itemId,
        np.categoryId,
        np.pricelog2,
        array_agg(opt.token) AS name_tokens
    FROM new_product AS np
    LEFT JOIN old_product_name_token AS opt
    ON np.itemId = opt.itemId
    GROUP BY np.itemId, np.categoryId, np.pricelog2                        
""").df()
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /graph/guming/projects/Automatic-Table-to-Graph-Generation/main/preprocessin │
│ g_dataset.py:1206 in main                                                    │
│                                                                              │
│   1203 │   │   #     ON np.itemId = opt.itemId                               │
│   1204 │   │   #     GROUP BY np.itemId, np.categoryId, np.pricelog2         │
│   1205 │   │   # """)                                                        │
│ ❱ 1206 │   │   new_product = duckdb.sql("""                                  │
│   1207 │   │   │   SELECT np.itemId,                                         │
│   1208 │   │   │   │   np.categoryId,                                        │
│   1209 │   │   │   │   np.pricelog2,                                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │                        dataset = 'diginetica'                            │ │
│ │                   dataset_path = 'data'                                  │ │
│ │                      new_click = │   │    queryId  itemId                │ │
│ │                                  timestamp                               │ │
│ │                                  0              1   24857 2016-05-09     │ │
│ │                                  20:27:02.181                            │ │
│ │                                  1          46255   30792 2016-05-09     │ │
│ │                                  20:28:08.232                            │ │
│ │                                  2          46689    8252 2016-05-09     │ │
│ │                                  16:58:35.268                            │ │
│ │                                  3          46731   33969 2016-05-09     │ │
│ │                                  20:25:56.888                            │ │
│ │                                  4          46748    7837 2016-05-09     │ │
│ │                                  17:02:21.813                            │ │
│ │                                  ...          ...     ...                │ │
│ │                                  ...                                     │ │
│ │                                  1127759   980493   42906 2016-04-14     │ │
│ │                                  19:45:16.918                            │ │
│ │                                  1127760   980493   33312 2016-04-14     │ │
│ │                                  19:45:27.425                            │ │
│ │                                  1127761   980493   33312 2016-04-14     │ │
│ │                                  19:35:35.050                            │ │
│ │                                  1127762   980493    5227 2016-04-14     │ │
│ │                                  19:44:19.554                            │ │
│ │                                  1127763   980503   13296 2016-02-16     │ │
│ │                                  03:58:32.055                            │ │
│ │                                                                          │ │
│ │                                  [1127764 rows x 3 columns]              │ │
│ │                    new_product = │   │   itemId  categoryId  pricelog2   │ │
│ │                                  0       139578        1096          0   │ │
│ │                                  1       417975        1096          0   │ │
│ │                                  2       291805        1096          0   │ │
│ │                                  3       396921        1096          0   │ │
│ │                                  4       159257        1096          0   │ │
│ │                                  ...        ...         ...        ...   │ │
│ │                                  184042  384760         527          7   │ │
│ │                                  184043  386702         527          6   │ │
│ │                                  184044  384854         527          6   │ │
│ │                                  184045  128776         654          0   │ │
│ │                                  184046  128777         654          6   │ │
│ │                                                                          │ │
│ │                                  [184047 rows x 3 columns]               │ │
│ │                   new_purchase = │      purchase_session  purchaser      │ │
│ │                                  ordernumber  itemId                     │ │
│ │                                  timestamp                               │ │
│ │                                  0                   150    18278.0      │ │
│ │                                  16421   25911 2016-05-06 05:42:32.820   │ │
│ │                                  1                   151        NaN      │ │
│ │                                  16290  175874 2016-05-06 02:21:59.832   │ │
│ │                                  2                   156        7.0      │ │
│ │                                  21173   35324 2016-06-16 16:19:09.736   │ │
│ │                                  3                   179        NaN      │ │
│ │                                  16924   31233 2016-05-09 15:28:48.713   │ │
│ │                                  4                   246       34.0      │ │
│ │                                  16936   34677 2016-05-09 04:42:46.525   │ │
│ │                                  ...                 ...        ...      │ │
│ │                                  ...     ...                     ...     │ │
│ │                                  18020            600131        NaN      │ │
│ │                                  5675   40804 2016-03-18 06:10:06.463    │ │
│ │                                  18021            600250        NaN      │ │
│ │                                  19629   33777 2016-05-21 18:37:20.278   │ │
│ │                                  18022            600432        NaN      │ │
│ │                                  13928   17176 2016-04-25 09:36:30.154   │ │
│ │                                  18023            600432        NaN      │ │
│ │                                  13928   13662 2016-04-25 09:36:30.154   │ │
│ │                                  18024            600661        NaN      │ │
│ │                                  18363  379345 2016-05-15 08:02:06.036   │ │
│ │                                                                          │ │
│ │                                  [18025 rows x 5 columns]                │ │
│ │                      new_query = │   │   queryId  query_sessionId  ...   │ │
│ │                                  categoryId               timestamp      │ │
│ │                                  0             1                1  ...   │ │
│ │                                  0 2016-05-09 20:26:50.394               │ │
│ │                                  1         46255                1  ...   │ │
│ │                                  0 2016-05-09 20:28:00.000               │ │
│ │                                  2         46689                1  ...   │ │
│ │                                  0 2016-05-09 16:57:55.835               │ │
│ │                                  3         46731                1  ...   │ │
│ │                                  0 2016-05-09 20:24:52.144               │ │
│ │                                  4         46748                1  ...   │ │
│ │                                  0 2016-05-09 17:02:10.871               │ │
│ │                                  ...         ...              ...  ...   │ │
│ │                                  ...                     ...             │ │
│ │                                  923119   980488           600681  ...   │ │
│ │                                  1121 2016-04-07 20:10:38.903            │ │
│ │                                  923121   980490           600683  ...   │ │
│ │                                  724 2016-03-25 12:43:55.106             │ │
│ │                                  923122   980492           173679  ...   │ │
│ │                                  981 2016-05-07 13:47:03.536             │ │
│ │                                  923123   980493           600684  ...   │ │
│ │                                  974 2016-04-14 19:34:46.022             │ │
│ │                                  923126   980503           600687  ...   │ │
│ │                                  305 2016-02-16 03:56:19.192             │ │
│ │                                                                          │ │
│ │                                  [636160 rows x 6 columns]               │ │
│ │               new_query_result = │   │   queryId  itemId                 │ │
│ │                                  timestamp                               │ │
│ │                                  0             1    7518 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1      71 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1   30311 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1    7837 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  0             1   30792 2016-05-09      │ │
│ │                                  20:26:50.394                            │ │
│ │                                  ...         ...     ...                 │ │
│ │                                  ...                                     │ │
│ │                                  923126   980503   57719 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503   13296 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503   29388 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503  158860 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                  923126   980503  126076 2016-02-16      │ │
│ │                                  03:56:19.192                            │ │
│ │                                                                          │ │
│ │                                  [92271275 rows x 3 columns]             │ │
│ │ new_query_search_string_tokens = │      queryId search_token             │ │
│ │                                  0            1        16655             │ │
│ │                                  0            1       244087             │ │
│ │                                  0            1        51531             │ │
│ │                                  0            1       529597             │ │
│ │                                  0            1        58153             │ │
│ │                                  ...        ...          ...             │ │
│ │                                  81606    53450       296114             │ │
│ │                                  81607    53452       528937             │ │
│ │                                  81609    53453         5742             │ │
│ │                                  81609    53453       146356             │ │
│ │                                  81609    53453        41709             │ │
│ │                                                                          │ │
│ │                                  [138260 rows x 2 columns]               │ │
│ │                       new_view = │   │    view_session  view_user        │ │
│ │                                  itemId               timestamp          │ │
│ │                                  0                   1        NaN        │ │
│ │                                  81766 2016-05-09 16:03:29.629           │ │
│ │                                  1                   1        NaN        │ │
│ │                                  31331 2016-05-09 16:11:54.338           │ │
│ │                                  2                   1        NaN        │ │
│ │                                  32118 2016-05-09 15:58:46.889           │ │
│ │                                  3                   1        NaN        │ │
│ │                                  9654 2016-05-09 15:55:59.168            │ │
│ │                                  4                   1        NaN        │ │
│ │                                  32627 2016-05-09 16:13:15.728           │ │
│ │                                  ...               ...        ...        │ │
│ │                                  ...                     ...             │ │
│ │                                  1235375        600684        NaN        │ │
│ │                                  42906 2016-04-14 19:45:18.875           │ │
│ │                                  1235376        600684        NaN        │ │
│ │                                  33312 2016-04-14 19:45:29.544           │ │
│ │                                  1235377        600684        NaN        │ │
│ │                                  33312 2016-04-14 19:35:38.643           │ │
│ │                                  1235378        600684        NaN        │ │
│ │                                  5227 2016-04-14 19:44:21.298            │ │
│ │                                  1235379        600687   249347.0        │ │
│ │                                  13296 2016-02-16 03:58:34.480           │ │
│ │                                                                          │ │
│ │                                  [1235380 rows x 4 columns]              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
CatalogException: Catalog Error: Table with name old_product_name_token does not
exist!
Did you mean "pg_constraint"?

@CurryTang
Copy link
Collaborator

That's weird. The final fix would be adding this variable to the context of duckdb. I will check this after a deadline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants