sql_utils/public/functions/datetime.proto (50 lines of code) (raw):
//
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto2";
package bigquery_ml_utils.functions;
// The numeric values for these should not be changed in order to ensure
// compatibility when used in protos.
enum DateTimestampPart {
// User code that switches on this enum must have a default case so builds
// won't break if new enums get added.
// LINT: LEGACY_NAMES
__DateTimePart__switch_must_have_a_default__ = -1;
YEAR = 1; // 0 - 10000
MONTH = 2; // 1 - 12
DAY = 3; // 1 - 31
DAYOFWEEK = 4; // 1=Sunday ... 7=Saturday
DAYOFYEAR = 5; // 1 - 366
QUARTER = 6; // 1 - 4
HOUR = 7; // 0 - 23
MINUTE = 8; // 0 - 59
SECOND = 9; // 0 - 59
MILLISECOND = 10; // 0 - 999
MICROSECOND = 11; // 0 - 999999
NANOSECOND = 12; // 0 - 999999999
DATE = 13; // -106650=kDateMin - 106650=kDateMax
WEEK = 14; // 0 - 53
DATETIME = 15; // [0001-01-01 00:00:00, 10000-01-01 00:00:00)
TIME = 16; // [00:00:00, 24:00:00)
ISOYEAR = 17; // 0 - 9999
ISOWEEK = 18; // 1 - 53
// WEEK(SUNDAY) is omitted because it is the same as WEEK.
WEEK_MONDAY = 19;
WEEK_TUESDAY = 20;
WEEK_WEDNESDAY = 21;
WEEK_THURSDAY = 22;
WEEK_FRIDAY = 23;
WEEK_SATURDAY = 24;
}