This week at Dozer #6

原文:https://getdozer.io/blog/this-week-at-dozer-6


🌟 Welcome to this week's update on Dozer! We are thrilled to announce the release of version v0.1.18, which brings a range of new features and improvements. Our team has been working diligently to enhance the overall functionality, and we are eager for you to experience all the new additions. Here are the updates for this week.

Key enhancement of v0.1.18 🚀

Support for Loading Dozer Config from a URL #1440 🌐:

In this release, Dozer introduces the ability to load configuration files from a remote URL. This feature simplifies configuration management and deployment. Now, you can run the following command to load the remore dozer config file:

dozer -c remote_url/dozer_config.yaml

Configurable Secondary Index #1461 🔧:

Secondary indexes can now be customized, offering more control over the database structure and optimization. To get gist of this feature, we will use a data sample from the following repository: https://github.com/getdozer/dozer-samples/tree/main/sql/join

Before implementing the secondary index configuration, the following dozer configuration would throw a 500 error:

connections:
  - config : !LocalStorage
      details:
        path: data
      tables:
        - !Table
          name: trips
          prefix: /trips
          file_type: parquet
          extension: .parquet
    name: ny_taxi


endpoints:
  - name: trips
    path: /trips
    table_name: trips
    index:
      secondary:
        create:


cache_max_map_size: 10000000000

query the data:

POST localhost:8080/trips/query
{
    "$filter": {
        "hvfhs_license_num": "HV0003"
    },
    "$order_by": {
        "trip_miles": "desc"
    }
}

the query result will throw an error:

Failed to query cache: Plan error: Matching index not found. Try to add following secondary index configuration:
- index: !SortedInverted
    fields:
    - hvfhs_license_num
    - trip_miles

Now, you can create and configure the secondary index as follows:

g : !LocalStorage
 details:
 path: data
 tables:
 - !Table
 name: trips
 prefix: /trips
 file_type: parquet
 extension: .parquet
 name: ny_taxi


endpoints:
 - name: trips
 path: /trips
 table_name: trips
 index:
 secondary:
 create:
 - index: !SortedInverted
 fields:
 - hvfhs_license_num
 - trip_miles


cache_max_map_size: 10000000000

After configuring the secondary index, you will get a query result like this:

[
    {
        "hvfhs_license_num": "HV0003",
        "dispatching_base_num": "B03404",
        "originating_base_num": "B03404",
        "request_datetime": "2022-01-01T00:13:51.000Z",
        "on_scene_datetime": "2022-01-01T00:19:52.000Z",
        "pickup_datetime": "2022-01-01T00:19:52.000Z",
        "dropoff_datetime": "2022-01-01T01:34:54.000Z",
        "PULocationID": 138,
        "DOLocationID": 265,
        "trip_miles": 63.33,
        "trip_time": 4502,
        "base_passenger_fare": 166.66,
        "tolls": 26.55,
        "bcf": 5.87,
        "sales_tax": 0.0,
        "congestion_surcharge": 0.0,
        "airport_fee": 2.5,
        "tips": 0.0,
        "driver_pay": 127.05,
        "shared_request_flag": "N",
        "shared_match_flag": "N",
        "access_a_ride_flag": " ",
        "wav_request_flag": "N",
        "wav_match_flag": "N",
        "__dozer_record_id": 8283,
        "__dozer_record_version": 1
    },
    ...
]

Other Fixes and Improvements 🛠️:

A variety of fixes and improvements have been made in this release, including UUID Postgres type support (#1458), optional AccessFilter::fields (#1436), and improved error messages for CustomTypeNotSupported (#1459).

New Contributor Spotlight 🌟

We would like to extend a warm welcome to @nurikk, who made their first contribution in #1460. We appreciate your support and look forward to your future contributions!

Dozer v0.1.18 is available now. Check out the release notes here.

Looking Forward & Spoiler Alert 🌈

As we continue to make strides in improving Dozer, we remain committed to enhancing its features and functionality. Your feedback is invaluable to us, so please don't hesitate to reach out with any suggestions or ideas. You can always open an issue for feature request OR start a discusisuon thread under our GitHub Q&A category. Together, we can make Dozer the best it can be!

Dozer Cloud will be out soon with rich set of features, enabling developers to to build and deploy Data APIs with more ease! ✨ 🧙♀️

Full Changelog

Contact us 📬

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,324评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,303评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,192评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,555评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,569评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,566评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,927评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,583评论 0 257
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,827评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,590评论 2 320
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,669评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,365评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,941评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,928评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,159评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,880评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,399评论 2 342

推荐阅读更多精彩内容