Review Board 1.7.22


[PIG-3341] Strict datetime parsing and improve performance of loading datetime values

Review Request #11834 - Created June 12, 2013 and submitted

Rohini Palaniswamy
PIG-3341
Reviewers
pig
pig
Moved to ISODateTimeFormat as recommended by Pat Chan

Also added some missing documentation for DateTime. 
Unit tests modified
http://svn.apache.org/repos/asf/pig/trunk/src/docs/src/documentation/content/xdocs/func.xml
Revision 1491971 New Change
[20] 4135 lines
[+20]
4136
     </p>
4136
     </p>
4137
</section>
4137
</section>
4138
</section>
4138
</section>
4139

    
   
4139

   
4140
<!-- ======================================================== -->  
4140
<!-- ======================================================== -->  
4141
 <section id="subtract-duratioin">
4141
 <section id="subtract-duration">
4142
   <title>SubtractDuration</title>
4142
   <title>SubtractDuration</title>
4143
   <p>Returns the result of a DateTime object minus a <a href="http://en.wikipedia.org/wiki/ISO_8601#Durations">Duration object</a>.</p>
4143
   <p>Returns the result of a DateTime object minus a <a href="http://en.wikipedia.org/wiki/ISO_8601#Durations">Duration object</a>.</p>
4144

    
   
4144

   
4145
<section>
4145
<section>
4146
   <title>Syntax</title>
4146
   <title>Syntax</title>
[+20] [20] 108 lines
[+20]
4255
Use the ToDate function to generate a DateTime object. Note that if the timezone is not specified with the ISO datetime string or by the timezone parameter, the default timezone will be used.
4255
Use the ToDate function to generate a DateTime object. Note that if the timezone is not specified with the ISO datetime string or by the timezone parameter, the default timezone will be used.
4256
      </p>
4256
      </p>
4257
</section>
4257
</section>
4258
</section>
4258
</section>
4259

    
   
4259

   

    
   
4260
<!-- ======================================================== -->

    
   
4261
<section id="to-milli-seconds">

    
   
4262
    <title>ToMilliSeconds</title>

    
   
4263
    <p>

    
   
4264
        Returns the number of milliseconds elapsed since January 1, 1970, 00:00:00.000 GMT

    
   
4265
        for a DateTime object.

    
   
4266
    </p>

    
   
4267

   

    
   
4268
    <section>

    
   
4269
        <title>Syntax</title>

    
   
4270
        <table>

    
   
4271
            <tr>

    
   
4272
                <td>

    
   
4273
                    <p>ToMilliSeconds(datetime)</p>

    
   
4274
                </td>

    
   
4275
            </tr>

    
   
4276
        </table>

    
   
4277
    </section>

    
   
4278

   

    
   
4279
    <section>

    
   
4280
        <title>Terms</title>

    
   
4281
        <table>

    
   
4282
            <tr>

    
   
4283
                <td>

    
   
4284
                    <p>datetime</p>

    
   
4285
                </td>

    
   
4286
                <td>

    
   
4287
                    <p>A datetime object.</p>

    
   
4288
                </td>

    
   
4289
            </tr>

    
   
4290
        </table>

    
   
4291
    </section>

    
   
4292

   

    
   
4293
    <section>

    
   
4294
        <title>Usage</title>

    
   
4295
        <p>

    
   
4296
            Use the ToMilliSeconds function to convert the DateTime to the number of

    
   
4297
            milliseconds that have passed since January 1, 1970 00:00:00.000 GMT.

    
   
4298
        </p>

    
   
4299
    </section>

    
   
4300
</section>

    
   
4301

   

    
   
4302
<!-- ======================================================== -->

    
   
4303
<section id="to-unix-time">

    
   
4304
    <title>ToUnixTime</title>

    
   
4305
    <p>

    
   
4306
        Returns the Unix Time as long for a DateTime object. UnixTime is the

    
   
4307
        number of seconds elapsed since January 1, 1970, 00:00:00.000 GMT.

    
   
4308
    </p>

    
   
4309

   

    
   
4310
    <section>

    
   
4311
        <title>Syntax</title>

    
   
4312
        <table>

    
   
4313
            <tr>

    
   
4314
                <td>

    
   
4315
                    <p>ToUnixTime(datetime)</p>

    
   
4316
                </td>

    
   
4317
            </tr>

    
   
4318
        </table>

    
   
4319
    </section>

    
   
4320

   

    
   
4321
    <section>

    
   
4322
        <title>Terms</title>

    
   
4323
        <table>

    
   
4324
            <tr>

    
   
4325
                <td>

    
   
4326
                    <p>datetime</p>

    
   
4327
                </td>

    
   
4328
                <td>

    
   
4329
                    <p>A datetime object.</p>

    
   
4330
                </td>

    
   
4331
            </tr>

    
   
4332
        </table>

    
   
4333
    </section>

    
   
4334

   

    
   
4335
    <section>

    
   
4336
        <title>Usage</title>

    
   
4337
        <p>

    
   
4338
            Use the ToUnixTime function to convert the DateTime to Unix Time.

    
   
4339
        </p>

    
   
4340
    </section>

    
   
4341
</section>

    
   
4342

   
4260
<!-- ======================================================== -->  
4343
<!-- ======================================================== -->  
4261
 <section id="weeks-between">
4344
 <section id="weeks-between">
4262
   <title>WeeksBetween</title>
4345
   <title>WeeksBetween</title>
4263
   <p>Returns the number of weeks between two DateTime objects.</p>
4346
   <p>Returns the number of weeks between two DateTime objects.</p>
4264

    
   
4347

   
[+20] [20] 382 lines
http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/Main.java
Revision 1491971 New Change
 
http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java
Revision 1491971 New Change
 
http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/ToDate.java
Revision 1491971 New Change
 
http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/ToDateISO.java
Revision 1491971 New Change
 
http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/ToMilliSeconds.java
Revision 1491971 New Change
 
http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/Utf8StorageConverter.java
Revision 1491971 New Change
 
http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/data/DataType.java
Revision 1491971 New Change
 
http://svn.apache.org/repos/asf/pig/trunk/test/org/apache/pig/test/TestDefaultDateTimeZone.java
Revision 1491971 New Change
 
  1. http://svn.apache.org/repos/asf/pig/trunk/src/docs/src/documentation/content/xdocs/func.xml: Loading...
  2. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/Main.java: Loading...
  3. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java: Loading...
  4. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/ToDate.java: Loading...
  5. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/ToDateISO.java: Loading...
  6. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/ToMilliSeconds.java: Loading...
  7. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/builtin/Utf8StorageConverter.java: Loading...
  8. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/data/DataType.java: Loading...
  9. http://svn.apache.org/repos/asf/pig/trunk/test/org/apache/pig/test/TestDefaultDateTimeZone.java: Loading...