是否可以从Parquet和NoSQL目标中删除特定项目?

huangapple go评论72阅读模式
英文:

Is it possible to remove specific items from Parquet and NoSQL Targets?

问题

MLRun中是否可以从Parquet和NoSQL目标中删除特定项?我没有找到相关的方法,我检查了FeatureStore、ParquetTarget和NoSQLTarget。

我只看到了从元数据存储(从数据库中)删除整个特征集的能力,而没有触及特定数据项 请参见

mlrun.feature_store.delete_feature_set(name, project='', tag=None, uid=None, force=False)

但这不符合我的情况,我需要只删除特定的数据项(而不是元数据存储中的信息)。感谢帮助。

顺便说一句:我正在使用MLRun版本1.2.1。

英文:

Is it possible to remove specific items from Parquet and NoSQL Targets in MLRun? I did not find relevant methods and I checked FeatureStore, ParquetTarget and NoSQLTarget.

I only saw ability to remove whole featureset from metastore (from DB) without touch of specific data items see:

mlrun.feature_store.delete_feature_set(name, project='', tag=None, uid=None, force=False)

But it is not my case, I have to remove only specific data items (not information from metastore). Thanks for help.

BTW: I am using MLRun version 1.2.1

答案1

得分: 0

  1. 关于 ParquetTarget

    • 这个格式是不可变的
    • 但是,如果你在 Parquet 中使用分区,那么你可以删除特定的 Parquet 文件。例如,如果你按年份进行分区,你可以轻松地通过命令行 rm 删除文件系统中特定年份的文件,从而实际上删除了请求的内容。
  2. 关于 NoSqlTarget

    • 这不是不可变格式,你可以轻松更新值,但 MLRun 1.2.1 没有相关的删除项的 API。
    • 你可以在文件系统上查看每个键的持久性(v3io 兼容文件系统)。这意味着你也可以通过删除文件(键或键)来删除内容(再次通过命令行 rm)。
  3. 关于 RedisTarget

    • 它与 NoSqlTarget 类似(轻松更新值)
    • 你可以从 Redis 获得完整的支持以删除键

命令行:

DEL user
redis-cli KEYS "user*" | xargs redis-cli DEL

Python 代码:

import redis

r = redis.Redis()
r.delete('test')
英文:

I did not see relevant method in MLRun 1.2.1, but you can use a few work-arounds.

1. About ParquetTarget

  • this format is immutable
  • but in case that you use partitioning in parquet, than you can remove specific parquet file(s). E.g. if you use partitioning by years, you can easy delete file (via command line rm) on file system specific year and practically you delete requested content.

2. About NoSqlTarget

  • this is not immutable format and you can easy update value(s), but MLRun 1.2.1 is without relevant API for delete items
  • you can see persistence of each key on file systems (v3io is compatible with file system). It means you can also delete content (key or keys) via delete file(s) (again via command line rm).

3. About RedisTarget

  • it is near to NoSqlTarget (easy update of values)
  • you can see full support from redis for delete key(s)

command lines:

DEL user
redis-cli KEYS "user*" | xargs redis-cli DEL

code in python:

import redis

r = redis.Redis()
r.delete('test')

huangapple
  • 本文由 发表于 2023年3月31日 21:36:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75899177.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定