[jira] [Updated] (NIFI-12885) MapRecord.getAsDate timestamp breaking bug

2024-03-12 Thread crissaegrim (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

crissaegrim updated NIFI-12885:
---
Attachment: .png

> MapRecord.getAsDate timestamp breaking bug
> --
>
> Key: NIFI-12885
> URL: https://issues.apache.org/jira/browse/NIFI-12885
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 2.0.0-M2
>Reporter: crissaegrim
>Priority: Major
> Attachments: .png
>
>
> I think I found a breaking bug from this commit 
> [https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]
> The below passes in 1.20.0 but fails in 2.0
> {code:java}
> @Test
> void testBasic() throws Exception {
> // setup
> final String schemaText = "{" +
> "\"type\" : \"record\"," +
> "\"name\" : \"TestRecord\"," +
> "\"namespace\" : \"org.apache.nifi\"," +
> "\"fields\" : [ {" +
> "\"name\" : \"my_datestamp_field\"," +
> "\"type\" : {" +
> "\"type\" : \"long\"," +
> "\"logicalType\" : \"timestamp-millis\"" +
> "}" +
> "} ]" +
>   "}";
> final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
> Schema.Parser().parse(schemaText));
> final HashMap item = new HashMap<>();
> item.put("my_datestamp_field", "2022-01-01 10:00:00.000");
> // act
> final MapRecord record = new MapRecord(schemaParsed, item);
> final Date myDateStampField = record.getAsDate("my_datestamp_field", 
> "-MM-dd HH:mm:ss.SSS");
> // assert
>   // fails in 2.0; actual in 2.0.0-M2 is `164099520`
> assertEquals(164103120L, myDateStampField.getTime());
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-12885) MapRecord.getAsDate timestamp breaking bug

2024-03-11 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-12885:

Priority: Major  (was: Critical)

> MapRecord.getAsDate timestamp breaking bug
> --
>
> Key: NIFI-12885
> URL: https://issues.apache.org/jira/browse/NIFI-12885
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 2.0.0-M2
>Reporter: crissaegrim
>Priority: Major
>
> I think I found a breaking bug from this commit 
> [https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]
> The below passes in 1.20.0 but fails in 2.0
> {code:java}
> @Test
> void testBasic() throws Exception {
> // setup
> final String schemaText = "{" +
> "\"type\" : \"record\"," +
> "\"name\" : \"TestRecord\"," +
> "\"namespace\" : \"org.apache.nifi\"," +
> "\"fields\" : [ {" +
> "\"name\" : \"my_datestamp_field\"," +
> "\"type\" : {" +
> "\"type\" : \"long\"," +
> "\"logicalType\" : \"timestamp-millis\"" +
> "}" +
> "} ]" +
>   "}";
> final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
> Schema.Parser().parse(schemaText));
> final HashMap item = new HashMap<>();
> item.put("my_datestamp_field", "2022-01-01 10:00:00.000");
> // act
> final MapRecord record = new MapRecord(schemaParsed, item);
> final Date myDateStampField = record.getAsDate("my_datestamp_field", 
> "-MM-dd HH:mm:ss.SSS");
> // assert
>   // fails in 2.0; actual in 2.0.0-M2 is `164099520`
> assertEquals(164103120L, myDateStampField.getTime());
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-12885) MapRecord.getAsDate timestamp breaking bug

2024-03-11 Thread David Handermann (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-12885:

Issue Type: Bug  (was: New Feature)

> MapRecord.getAsDate timestamp breaking bug
> --
>
> Key: NIFI-12885
> URL: https://issues.apache.org/jira/browse/NIFI-12885
> Project: Apache NiFi
>  Issue Type: Bug
>Affects Versions: 2.0.0-M2
>Reporter: crissaegrim
>Priority: Critical
>
> I think I found a breaking bug from this commit 
> [https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]
> The below passes in 1.20.0 but fails in 2.0
> {code:java}
> @Test
> void testBasic() throws Exception {
> // setup
> final String schemaText = "{" +
> "\"type\" : \"record\"," +
> "\"name\" : \"TestRecord\"," +
> "\"namespace\" : \"org.apache.nifi\"," +
> "\"fields\" : [ {" +
> "\"name\" : \"my_datestamp_field\"," +
> "\"type\" : {" +
> "\"type\" : \"long\"," +
> "\"logicalType\" : \"timestamp-millis\"" +
> "}" +
> "} ]" +
>   "}";
> final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
> Schema.Parser().parse(schemaText));
> final HashMap item = new HashMap<>();
> item.put("my_datestamp_field", "2022-01-01 10:00:00.000");
> // act
> final MapRecord record = new MapRecord(schemaParsed, item);
> final Date myDateStampField = record.getAsDate("my_datestamp_field", 
> "-MM-dd HH:mm:ss.SSS");
> // assert
>   // fails in 2.0; actual in 2.0.0-M2 is `164099520`
> assertEquals(164103120L, myDateStampField.getTime());
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-12885) MapRecord.getAsDate timestamp breaking bug

2024-03-11 Thread crissaegrim (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

crissaegrim updated NIFI-12885:
---
Description: 
I think I found a breaking bug from this commit 
[https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]

The below passes in 1.20.0 but fails in 2.0
{code:java}
@Test
void testBasic() throws Exception {
// setup
final String schemaText = "{" +
"\"type\" : \"record\"," +
"\"name\" : \"TestRecord\"," +
"\"namespace\" : \"org.apache.nifi\"," +
"\"fields\" : [ {" +
"\"name\" : \"my_datestamp_field\"," +
"\"type\" : {" +
"\"type\" : \"long\"," +
"\"logicalType\" : \"timestamp-millis\"" +
"}" +
"} ]" +
  "}";
final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
Schema.Parser().parse(schemaText));

final HashMap item = new HashMap<>();
item.put("my_datestamp_field", "2022-01-01 10:00:00.000");

// act
final MapRecord record = new MapRecord(schemaParsed, item);
final Date myDateStampField = record.getAsDate("my_datestamp_field", 
"-MM-dd HH:mm:ss.SSS");

// assert
// fails in 2.0; actual in 2.0.0-M2 is `164099520`
assertEquals(164103120L, myDateStampField.getTime());
}
{code}

  was:
I think I found a breaking bug from this commit 
[https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]

The below passes in 1.20.0 but fails in 2.0
{code:java}
@Test
void testBasic() throws Exception {
// setup
final String schemaText = "{" +
"\"type\" : \"record\"," +
"\"name\" : \"TestRecord\"," +
"\"namespace\" : \"org.apache.nifi\"," +
"\"fields\" : [ {" +
"\"name\" : \"my_datestamp_field\"," +
"\"type\" : {" +
"\"type\" : \"long\"," +
"\"logicalType\" : \"timestamp-millis\"" +
"}" +
"} ]" +
  "}";
final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
Schema.Parser().parse(schemaText));

final HashMap item = new HashMap<>();
item.put("my_datestamp_field", "2022-01-01 10:00:00.000");

// act
final MapRecord record = new MapRecord(schemaParsed, item);
final Date myDateStampField = record.getAsDate("my_datestamp_field", 
"-MM-dd HH:mm:ss.SSS");

// assert
// fails in 2.0; actual is `164099520`
assertEquals(164103120L, myDateStampField.getTime());
}
{code}


> MapRecord.getAsDate timestamp breaking bug
> --
>
> Key: NIFI-12885
> URL: https://issues.apache.org/jira/browse/NIFI-12885
> Project: Apache NiFi
>  Issue Type: New Feature
>Affects Versions: 2.0.0-M2
>Reporter: crissaegrim
>Priority: Critical
>
> I think I found a breaking bug from this commit 
> [https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]
> The below passes in 1.20.0 but fails in 2.0
> {code:java}
> @Test
> void testBasic() throws Exception {
> // setup
> final String schemaText = "{" +
> "\"type\" : \"record\"," +
> "\"name\" : \"TestRecord\"," +
> "\"namespace\" : \"org.apache.nifi\"," +
> "\"fields\" : [ {" +
> "\"name\" : \"my_datestamp_field\"," +
> "\"type\" : {" +
> "\"type\" : \"long\"," +
> "\"logicalType\" : \"timestamp-millis\"" +
> "}" +
> "} ]" +
>   "}";
> final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
> Schema.Parser().parse(schemaText));
> final HashMap item = new HashMap<>();
> item.put("my_datestamp_field", "2022-01-01 10:00:00.000");
> // act
> final MapRecord record = new MapRecord(schemaParsed, item);
> final Date myDateStampField = record.getAsDate("my_datestamp_field", 
> "-MM-dd HH:mm:ss.SSS");
> // assert
>   // fails in 2.0; actual in 2.0.0-M2 is `164099520`
> assertEquals(164103120L, myDateStampField.getTime());
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (NIFI-12885) MapRecord.getAsDate timestamp breaking bug

2024-03-11 Thread crissaegrim (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-12885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

crissaegrim updated NIFI-12885:
---
Description: 
I think I found a breaking bug from this commit 
[https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]

The below passes in 1.20.0 but fails in 2.0
{code:java}
@Test
void testBasic() throws Exception {
// setup
final String schemaText = "{" +
"\"type\" : \"record\"," +
"\"name\" : \"TestRecord\"," +
"\"namespace\" : \"org.apache.nifi\"," +
"\"fields\" : [ {" +
"\"name\" : \"my_datestamp_field\"," +
"\"type\" : {" +
"\"type\" : \"long\"," +
"\"logicalType\" : \"timestamp-millis\"" +
"}" +
"} ]" +
  "}";
final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
Schema.Parser().parse(schemaText));

final HashMap item = new HashMap<>();
item.put("my_datestamp_field", "2022-01-01 10:00:00.000");

// act
final MapRecord record = new MapRecord(schemaParsed, item);
final Date myDateStampField = record.getAsDate("my_datestamp_field", 
"-MM-dd HH:mm:ss.SSS");

// assert
// fails in 2.0; actual is `164099520`
assertEquals(164103120L, myDateStampField.getTime());
}
{code}

  was:
I think I found a breaking bug from this commit 
[https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]

The below passes in 1.20.0 but fails in 2.0
{code:java}
@Test
void testBasic() throws Exception {
// setup
final String schemaText = "{" +
"\"type\" : \"record\"," +
"\"name\" : \"TestRecord\"," +
"\"namespace\" : \"org.apache.nifi\"," +
"\"fields\" : [ {" +
"\"name\" : \"my_datestamp_field\"," +
"\"type\" : {" +
"\"type\" : \"long\"," +
"\"logicalType\" : \"timestamp-millis\"" +
"}" +
"} ]" +
  "}";
final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
Schema.Parser().parse(schemaText));

final HashMap item = new HashMap<>();
item.put("my_datestamp_field", "2022-01-01 10:00:00.000");

// act
final MapRecord record = new MapRecord(schemaParsed, item);
final Date myDateStampField = record.getAsDate("my_datestamp_field", 
"-MM-dd HH:mm:ss.SSS");

// assert
// fails in 2.0; actual is `164099520`
assertEquals(164103120L, myDateStampField.getTime());
}
{code}


> MapRecord.getAsDate timestamp breaking bug
> --
>
> Key: NIFI-12885
> URL: https://issues.apache.org/jira/browse/NIFI-12885
> Project: Apache NiFi
>  Issue Type: New Feature
>Affects Versions: 2.0.0-M2
>Reporter: crissaegrim
>Priority: Critical
>
> I think I found a breaking bug from this commit 
> [https://github.com/apache/nifi/commit/250fe90b348fac515ea597c1985ca432ac7c3ac3#diff-ce496d3f0fc5a7e8a3c0431972f7069b4cf1af2e94f3a199f595ef195eb5ebfa]
> The below passes in 1.20.0 but fails in 2.0
> {code:java}
> @Test
> void testBasic() throws Exception {
> // setup
> final String schemaText = "{" +
> "\"type\" : \"record\"," +
> "\"name\" : \"TestRecord\"," +
> "\"namespace\" : \"org.apache.nifi\"," +
> "\"fields\" : [ {" +
> "\"name\" : \"my_datestamp_field\"," +
> "\"type\" : {" +
> "\"type\" : \"long\"," +
> "\"logicalType\" : \"timestamp-millis\"" +
> "}" +
> "} ]" +
>   "}";
> final RecordSchema schemaParsed = AvroTypeUtil.createSchema(new 
> Schema.Parser().parse(schemaText));
> final HashMap item = new HashMap<>();
> item.put("my_datestamp_field", "2022-01-01 10:00:00.000");
> // act
> final MapRecord record = new MapRecord(schemaParsed, item);
> final Date myDateStampField = record.getAsDate("my_datestamp_field", 
> "-MM-dd HH:mm:ss.SSS");
> // assert
>   // fails in 2.0; actual is `164099520`
> assertEquals(164103120L, myDateStampField.getTime());
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)