Skip to content

Instantly share code, notes, and snippets.

@ferozed
ferozed / avro-serializer-exception.txt
Last active April 17, 2024 23:31
Avro Serializer Exception
Error encountered in task crm-tag-update-event-prod-s3-sink-0. Executing stage 'VALUE_CONVERTER' with class 'io.confluent.connect.avro.AvroConverter', where consumed record is {topic='crm-tag-update-event-prod-topic', partition=0, offset=52510041, timestamp=1713396004969, timestampType=CreateTime}.
org.apache.kafka.connect.errors.DataException: Failed to deserialize data for topic crm-tag-update-event-prod-topic to Avro:
at io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:124)
at org.apache.kafka.connect.storage.Converter.toConnectData(Converter.java:88)
at org.apache.kafka.connect.runtime.WorkerSinkTask.lambda$convertAndTransformRecord$5(WorkerSinkTask.java:519)
at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:183)
at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:217)
at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execu
Name Type
id string
environment string
sender string
send_epoch_time_millis bigint
logical_date date
logical_time_millis int
logical_time_micros bigint
logical_timestamp_millis timestamp
message com.ferozed.LogicalType { 
  required binary id (STRING); 
  optional binary environment (STRING);
  optional binary sender (STRING); 
  optional int64 send_epoch_time_millis; 
  required int32 logical_date (DATE); 
  required int32 logical_time_millis (TIME(MILLIS,true)); 
  required int64 logical_time_micros; 
 required int64 logical_timestamp_millis (TIMESTAMP(MILLIS,true)); 
{
"name": "timestamp_millis",
"type": {
"type": "long",
"logicalType": "timestamp_millis"
},
"doc": "An avro timestamp_millis logical type"
}
@ferozed
ferozed / hive-logic-type.hql
Last active November 27, 2021 19:48
Create Hive Table Statement
CREATE EXTERNAL TABLE `warehouse.logical_type_test`(
`id` string COMMENT '',
`environment` string COMMENT '',
`sender` string COMMENT '',
`send_epoch_time_millis` bigint COMMENT '',
`logical_date` date COMMENT '',
`logical_time_millis` int COMMENT '',
`logical_time_micros` bigint COMMENT '',
`logical_timestamp_millis` timestamp COMMENT '',
`logical_timestamp_micros` bigint COMMENT '',
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package com.example;
import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
@ferozed
ferozed / test.avsc
Created July 5, 2020 05:16
Example Avro schema
{
"type": "record",
"namespace": "com.example",
"name": "FullName",
"fields": [
{ "name": "first", "type": "string" },
{ "name": "last", "type": "string" }
]
}
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
@ferozed
ferozed / SocketSendFile.cs
Created December 11, 2016 03:12
Socket.SendFile performance benchmark
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Net.Cache;
using System.Threading;
@ferozed
ferozed / mimepart.cs
Created December 11, 2016 02:29
MimePart Class Specification
///
/// MimePart
/// Abstract class for all MimeParts
///
abstract class MimePart
{
public string Name { get; set; }
public abstract string ContentDisposition { get; }