Skip to content

Conversation

@evanevanevanevannnn
Copy link
Collaborator

Changelog entry

fix for YQ-2950

Changelog category

  • Improvement

@evanevanevanevannnn evanevanevanevannnn changed the title date data type formatting added format setting supported for data type Nov 14, 2024
@evanevanevanevannnn evanevanevanevannnn changed the title format setting supported for data type format setting supported for date type Nov 14, 2024
@github-actions
Copy link

github-actions bot commented Nov 14, 2024

2024-11-14 13:42:54 UTC Pre-commit check linux-x86_64-relwithdebinfo for 56c7c6f has started.
2024-11-14 13:43:05 UTC Artifacts will be uploaded here
2024-11-14 13:46:04 UTC ya make is running...
🟡 2024-11-14 14:45:38 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
40450 34760 0 17 5559 114

2024-11-14 14:49:11 UTC ya make is running... (failed tests rerun, try 2)
🟡 2024-11-14 15:01:24 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
125 (only retried tests) 15 0 1 1 108

2024-11-14 15:01:32 UTC ya make is running... (failed tests rerun, try 3)
🔴 2024-11-14 15:13:15 UTC Some tests failed, follow the links below.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
109 (only retried tests) 1 0 1 0 107

🟢 2024-11-14 15:13:22 UTC Build successful.
🟢 2024-11-14 15:13:45 UTC ydbd size 2.8 GiB changed* by +52.4 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: c6e9a17 merge: 56c7c6f diff diff %
ydbd size 3 052 982 032 Bytes 3 053 035 728 Bytes +52.4 KiB +0.002%
ydbd stripped size 483 021 152 Bytes 483 023 712 Bytes +2.5 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 14, 2024

2024-11-14 13:44:01 UTC Pre-commit check linux-x86_64-release-asan for 56c7c6f has started.
2024-11-14 13:44:14 UTC Artifacts will be uploaded here
2024-11-14 13:47:11 UTC ya make is running...
🟡 2024-11-14 14:55:04 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
9093 9003 0 38 9 43

🟢 2024-11-14 14:55:52 UTC Build successful.
🟡 2024-11-14 14:56:22 UTC ydbd size 5.8 GiB changed* by +124.7 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: c6e9a17 merge: 56c7c6f diff diff %
ydbd size 6 179 273 040 Bytes 6 179 400 712 Bytes +124.7 KiB +0.002%
ydbd stripped size 1 540 776 496 Bytes 1 540 803 056 Bytes +25.9 KiB +0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 14, 2024

2024-11-14 15:30:05 UTC Pre-commit check linux-x86_64-release-asan for ace75d8 has started.
2024-11-14 15:30:47 UTC Artifacts will be uploaded here
2024-11-14 15:34:33 UTC ya make is running...
🟡 2024-11-14 16:47:33 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
9096 8996 0 38 11 51

🟢 2024-11-14 16:48:23 UTC Build successful.
🟢 2024-11-14 16:48:53 UTC ydbd size 5.8 GiB changed* by +98.5 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: f00baa4 merge: ace75d8 diff diff %
ydbd size 6 179 298 160 Bytes 6 179 399 016 Bytes +98.5 KiB +0.002%
ydbd stripped size 1 540 780 752 Bytes 1 540 802 992 Bytes +21.7 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 14, 2024

2024-11-14 15:31:38 UTC Pre-commit check linux-x86_64-relwithdebinfo for ace75d8 has started.
2024-11-14 15:32:14 UTC Artifacts will be uploaded here
2024-11-14 15:35:54 UTC ya make is running...
🟡 2024-11-14 16:32:21 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
40464 34785 0 11 5558 110

2024-11-14 16:35:57 UTC ya make is running... (failed tests rerun, try 2)
🟢 2024-11-14 16:47:32 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
115 (only retried tests) 7 0 0 0 108

🟢 2024-11-14 16:47:40 UTC Build successful.
🟢 2024-11-14 16:47:59 UTC ydbd size 2.8 GiB changed* by +45.8 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: f282430 merge: ace75d8 diff diff %
ydbd size 3 052 992 072 Bytes 3 053 038 976 Bytes +45.8 KiB +0.002%
ydbd stripped size 483 022 688 Bytes 483 024 288 Bytes +1.6 KiB +0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

return true;
}

if (name == "data.date.format") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

дописал

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оказалось не удобным генерировать parquet файлы из вне. Посмотри в сторону этих тестов https://github.com/ydb-platform/ydb/blob/main/ydb/tests/fq/s3/test_format_setting.py#L1052 Это уже новые тесты которые удобно писать и читать

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

добавил

settings.Add(ctx.NewList(read.Pos(), std::move(pair)));
}

if (topicKeyParser.GetDateFormat()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А здесь для date нету общееизвестных форматов POSIX/ISO как для Timestamp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POSIX/ISO для даты выглядят одинакого - %Y-%m-%d

по совместительству это совпадает с дефолтным парсингом, поэтому показалось бессмысленно добавлять несколько одинаковых форматов

memset(&input_tm, 0, sizeof(tm));
input_tm.tm_mday = 1;

auto ptr = strptime(buf.position(), format.c_str(), &input_tm);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А нету другой функции которая бы сразу date бы проверяла? А то потом идут различные преобразования + 1900. Там никаки overflow быть не может? Еще не понятно почему mon на 1 сдвигается

Copy link
Collaborator Author

@evanevanevanevannnn evanevanevanevannnn Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не нашел функции, которая сразу в LocalDate/DayNum сможет распарсить согласно формату

преобразования такие потому что в struct tm нумерация месяцев с 0, а лет с 1900. а в LocalDate соответственно с единицы и нуля

int tm_mon; /* Month. [0-11] */
int tm_year; /* Year - 1900. */

{
LocalDate local_date;
readDateTextFormatImpl(local_date, buf, format);
/// When the parameter is out of rule or out of range, Date32 uses 1925-01-01 as the default value (-DateLUT::instance().getDayNumOffsetEpoch(), -16436) and Date uses 1970-01-01.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А мы точно хотим такое поведение? Может тут ошибку нужно выдавать. В Datetime какое поведение сейчас?

Copy link
Collaborator Author

@evanevanevanevannnn evanevanevanevannnn Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в datetime не помню, но в этом же файле для date и date32 (просто без настроек формата, на несколько строк выше) идентичное поведение

)

sql = f'''
INSERT INTO bindings.`{storage_sink_binding_name}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можешь попробовать прочитать то что записали и провалидировать результат?

Copy link
Collaborator Author

@evanevanevanevannnn evanevanevanevannnn Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

данные сравниваются с каноничными в /canondata/...

Copy link
Collaborator

@dorooleg dorooleg Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это сложно проверять. Точно ли канонические данные правильные? Это мне кажется еще одна ошибка была в соседних тестах так делать)

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 08:50:36 UTC Pre-commit check linux-x86_64-release-asan for b9de5ec has started.
2024-11-15 08:51:03 UTC Artifacts will be uploaded here
2024-11-15 08:54:31 UTC ya make is running...
🟡 2024-11-15 09:53:13 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
9088 9011 0 24 5 48

🟢 2024-11-15 09:54:01 UTC Build successful.
🟡 2024-11-15 09:54:30 UTC ydbd size 4.9 GiB changed* by +124.6 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 0a30799 merge: b9de5ec diff diff %
ydbd size 5 255 177 312 Bytes 5 255 304 952 Bytes +124.6 KiB +0.002%
ydbd stripped size 1 350 163 920 Bytes 1 350 188 336 Bytes +23.8 KiB +0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 08:52:07 UTC Pre-commit check linux-x86_64-relwithdebinfo for b9de5ec has started.
2024-11-15 08:52:19 UTC Artifacts will be uploaded here
2024-11-15 08:55:37 UTC ya make is running...
🟡 2024-11-15 09:51:42 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
40465 34783 0 10 5559 113

2024-11-15 09:55:09 UTC ya make is running... (failed tests rerun, try 2)
🟢 2024-11-15 10:06:26 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
120 (only retried tests) 12 0 0 1 107

🟢 2024-11-15 10:06:33 UTC Build successful.
🟢 2024-11-15 10:06:52 UTC ydbd size 2.5 GiB changed* by +72.8 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 0a30799 merge: b9de5ec diff diff %
ydbd size 2 681 687 976 Bytes 2 681 762 568 Bytes +72.8 KiB +0.003%
ydbd stripped size 480 769 008 Bytes 480 781 552 Bytes +12.2 KiB +0.003%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 10:46:08 UTC Pre-commit check linux-x86_64-release-asan for cbd4416 has started.
2024-11-15 10:46:17 UTC Artifacts will be uploaded here
2024-11-15 10:49:26 UTC ya make is running...
🟡 2024-11-15 11:51:24 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
9085 9016 0 15 9 45

🟢 2024-11-15 11:52:15 UTC Build successful.
🟡 2024-11-15 11:52:43 UTC ydbd size 4.9 GiB changed* by +124.7 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 087c886 merge: cbd4416 diff diff %
ydbd size 5 255 200 584 Bytes 5 255 328 232 Bytes +124.7 KiB +0.002%
ydbd stripped size 1 350 173 232 Bytes 1 350 197 648 Bytes +23.8 KiB +0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 10:47:45 UTC Pre-commit check linux-x86_64-relwithdebinfo for cbd4416 has started.
2024-11-15 10:47:56 UTC Artifacts will be uploaded here
2024-11-15 10:51:02 UTC ya make is running...
🟡 2024-11-15 11:47:33 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
40464 34623 0 3 5786 52

2024-11-15 11:50:59 UTC ya make is running... (failed tests rerun, try 2)
🟢 2024-11-15 12:02:21 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
288 (only retried tests) 174 0 0 7 107

🟢 2024-11-15 12:02:29 UTC Build successful.
🟢 2024-11-15 12:02:48 UTC ydbd size 2.5 GiB changed* by +72.8 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 087c886 merge: cbd4416 diff diff %
ydbd size 2 681 700 160 Bytes 2 681 774 688 Bytes +72.8 KiB +0.003%
ydbd stripped size 480 770 992 Bytes 480 783 472 Bytes +12.2 KiB +0.003%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 16:02:46 UTC Pre-commit check linux-x86_64-release-asan for 29d64d7 has started.
2024-11-15 16:03:26 UTC Artifacts will be uploaded here
2024-11-15 16:06:55 UTC ya make is running...
2024-11-15 16:15:39 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 16:04:24 UTC Pre-commit check linux-x86_64-relwithdebinfo for 29d64d7 has started.
2024-11-15 16:04:35 UTC Artifacts will be uploaded here
2024-11-15 16:07:38 UTC ya make is running...
2024-11-15 16:15:29 UTC Check cancelled

}

template <bool isOptional>
std::shared_ptr<arrow::Array> ArrowStringAsYqlDate(const std::shared_ptr<arrow::DataType>& targetType, const std::shared_ptr<arrow::Array>& value, const NDB::FormatSettings& formatSettings) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давай еще остальные конвертеры поддержим по аналогии с Datetime/Timestamp?

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 16:16:48 UTC Pre-commit check linux-x86_64-release-asan for 860f728 has started.
2024-11-15 16:18:00 UTC Artifacts will be uploaded here
2024-11-15 16:21:39 UTC ya make is running...
🟡 2024-11-15 17:20:28 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
9090 9024 0 17 4 45

🟢 2024-11-15 17:21:15 UTC Build successful.
🟡 2024-11-15 17:21:44 UTC ydbd size 4.9 GiB changed* by +300.6 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: b2ab948 merge: 860f728 diff diff %
ydbd size 5 257 175 424 Bytes 5 257 483 288 Bytes +300.6 KiB +0.006%
ydbd stripped size 1 350 622 736 Bytes 1 350 698 128 Bytes +73.6 KiB +0.006%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Nov 15, 2024

2024-11-15 16:19:33 UTC Pre-commit check linux-x86_64-relwithdebinfo for 860f728 has started.
2024-11-15 16:19:44 UTC Artifacts will be uploaded here
2024-11-15 16:23:01 UTC ya make is running...
🟡 2024-11-15 17:23:22 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
40470 34798 0 3 5558 111

2024-11-15 17:26:47 UTC ya make is running... (failed tests rerun, try 2)
🟢 2024-11-15 17:38:23 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
112 (only retried tests) 4 0 0 0 108

🟢 2024-11-15 17:38:31 UTC Build successful.
🟡 2024-11-15 17:38:50 UTC ydbd size 2.5 GiB changed* by +158.8 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: b2ab948 merge: 860f728 diff diff %
ydbd size 2 682 700 616 Bytes 2 682 863 200 Bytes +158.8 KiB +0.006%
ydbd stripped size 480 925 616 Bytes 480 950 832 Bytes +24.6 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@evanevanevanevannnn evanevanevanevannnn merged commit 8f7b4e4 into ydb-platform:main Nov 15, 2024
10 checks passed
@evanevanevanevannnn evanevanevanevannnn deleted the YQ_2950_fix branch November 15, 2024 19:39
evanevanevanevannnn added a commit to evanevanevanevannnn/ydb that referenced this pull request Nov 21, 2024
evanevanevanevannnn added a commit to evanevanevanevannnn/ydb that referenced this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants